Package Torello.JavaDoc
Class SummarySorterHelper
- java.lang.Object
-
- Torello.JavaDoc.SummarySorterHelper
-
public abstract class SummarySorterHelper extends java.lang.Object
An abstract helper class for user-providedSummarySorter.class
files for sorting the Table of Contents inside the Field / Method / Constructor Summaries inside a Java Doc Web Page.
Hi-Lited Source-Code:- View Here: Torello/JavaDoc/SummarySorterHelper.java
- Open New Browser-Tab: Torello/JavaDoc/SummarySorterHelper.java
File Size: 30,447 Bytes Line Count: 684 '\n' Characters Found
-
-
Field Summary
Method Category Title-Bar Strings Modifier and Type Field protected static String
APPENDABLE_M
protected static String
CHARSEQUENCE_M
protected static String
CLONEABLE_M
protected static String
CLOSEABLE_M
protected static String
COMPARABLE_M
protected static String[]
EXCEPTION_CHECKERS_M
protected static String
FINTERFACE_M
protected static String
FLUSHABLE_M
protected static String
ITERABLE_M
protected static String
ITERATOR_M
protected static String
OBJECT_M
protected static String
PRINTSTREAM_M
protected static String
REPLACEABLE_M
protected static String
VALUEOF_M
protected static String
VALUES_M
protected static String
WRITER_M
Field Category Title-Bar Strings Modifier and Type Field protected static String[]
EXCEPTION_CONVENIENCE_F
protected static String[]
ONLY_SERIALIZABLE_F
protected static String
SERIALIZABLE_F
protected static String
SINGLETON_F
Synthetic Enum Method Title-Bar Strings Modifier and Type Field protected static String[]
enum$M$Sections
protected static String[]
enum2$M$Sections
Misc. Title-Bar Strings Modifier and Type Field protected static String
DEF_ITER_REMOVE
protected static String
DEFAULT_COMP
protected static String[]
fInterface$M$Sections
protected static String
STATIC_FACTORY
-
Constructor Summary
Constructors Constructor Description SummarySorterHelper()
-
Method Summary
Short-Hand Methods (abbreviations for less Typing) Modifier and Type Method protected static boolean
cOR(Declaration d, String... sArr)
protected static boolean
eqOR(Declaration d, String... sArr)
protected static boolean
ewOR(Declaration d, String... sArr)
protected static boolean
swOR(Declaration d, String... sArr)
protected static UnreachableError
UE(Declaration d)
Method Sorter Categorization Helpers Modifier and Type Method protected static boolean
APPENDABLE_M(Method m)
protected static boolean
CHARSEQUENCE_M(Method m)
protected static boolean
CLONEABLE_M(Method m)
protected static boolean
CLOSEABLE_M(Method m)
protected static boolean
COMPARABLE_M(Method m)
protected static int
EXCEPTION_CHECKERS_M(Method m)
protected static boolean
FLUSHABLE_M(Method m)
protected static boolean
ITERATOR_M(Method m)
protected static boolean
OBJECT_M(Method m)
protected static boolean
PRINTSTREAM_M(Method m)
protected static boolean
REPLACEABLE_M(Method m)
protected static boolean
WRITER_M(Method m)
Enum Synthetic Methods Categorization Helpers Modifier and Type Method protected static int
enum$M$Sorter(Method m)
protected static int
enum2$M$Sorter(Method m)
Functional-Interface / Lambda-Target Methods Categorization Helpers Modifier and Type Method protected static int
fInterface$M$Sorter(String functionalIntMethName, Method m)
Field Sorter Categorization Helpers Modifier and Type Method protected static int
EXCEPTION_CONVENIENCE_F(Field f)
protected static int
ONLY_SERIALIZABLE_F(Field f)
protected static boolean
SERIALIZABLE_F(Field f)
-
-
-
Field Detail
-
OBJECT_M
protected static final java.lang.String OBJECT_M
Label for methods inherited from classObject
Checker MethodOBJECT_M(Method)
matches methods named:"hashCode", "toString", "equals"
- See Also:
OBJECT_M(Method)
, Constant Field Values- Code:
- Exact Field Declaration Expression:
protected static final String OBJECT_M = "<B CLASS=STBLabel>Methods:</B> class java.lang.Object";
-
COMPARABLE_M
protected static final java.lang.String COMPARABLE_M
Label for methods inherited from classCombarable
Checker MethodCOMPARABLE_M(Method)
matches methods named:"compareTo"
- See Also:
COMPARABLE_M(Method)
, Constant Field Values- Code:
- Exact Field Declaration Expression:
protected static final String COMPARABLE_M = "<B CLASS=STBLabel>Methods:</B> interface java.lang.Comparable";
-
CHARSEQUENCE_M
protected static final java.lang.String CHARSEQUENCE_M
Label for methods inherited from classCharSequence
Checker MethodCHARSEQUENCE_M(Method)
matches method named:"toString", "subSequence", "charAt", "length"
- See Also:
CHARSEQUENCE_M(Method)
, Constant Field Values- Code:
- Exact Field Declaration Expression:
protected static final String CHARSEQUENCE_M = "<B CLASS=STBLabel>Methods:</B> interface java.lang.CharSequence";
-
CLONEABLE_M
protected static final java.lang.String CLONEABLE_M
Label for methods inherited from classCloneable
Checker MethodCLONEABLE_M(Method)
matches method named:"clone"
- See Also:
CLONEABLE_M(Method)
, Constant Field Values- Code:
- Exact Field Declaration Expression:
protected static final String CLONEABLE_M = "<B CLASS=STBLabel>Methods:</B> interface java.lang.Cloneable";
-
ITERABLE_M
protected static final java.lang.String ITERABLE_M
Label for methods inherited from classIterable
- See Also:
- Constant Field Values
- Code:
- Exact Field Declaration Expression:
protected static final String ITERABLE_M = "<B CLASS=STBLabel>Methods:</B> interface java.lang.Iterable";
-
ITERATOR_M
protected static final java.lang.String ITERATOR_M
Label for methods inherited from classIterator
Checker MethodCLONEABLE_M(Method)
matches method named:"next", "hasNext", "remove", "forEachRemaining"
- See Also:
ITERATOR_M(Method)
, Constant Field Values- Code:
- Exact Field Declaration Expression:
protected static final String ITERATOR_M = "<B CLASS=STBLabel>Methods:</B> interface java.lang.Iterator";
-
APPENDABLE_M
protected static final java.lang.String APPENDABLE_M
Label for methods inherited from interfaceAppendable
Checker MethodAPPENDABLE_M(Method)
matches method named:"append"
- See Also:
APPENDABLE_M(Method)
, Constant Field Values- Code:
- Exact Field Declaration Expression:
protected static final String APPENDABLE_M = "<B CLASS=STBLabel>Methods:</B> interface java.lang.Appendable";
-
FINTERFACE_M
protected static final java.lang.String FINTERFACE_M
Label for methods in aFunctionalInterface
- See Also:
fInterface$M$Sections
,fInterface$M$Sorter(String, Method)
, Constant Field Values- Code:
- Exact Field Declaration Expression:
protected static final String FINTERFACE_M = "<B CLASS=STBLabel>@FunctionalInterface:</B> (Lambda) Method";
-
CLOSEABLE_M
protected static final java.lang.String CLOSEABLE_M
Label for methods inherited from classjava.io.Closeable
Checker MethodCLOSEABLE_M(Method)
matches method named:"close"
- See Also:
CLOSEABLE_M(Method)
, Constant Field Values- Code:
- Exact Field Declaration Expression:
protected static final String CLOSEABLE_M = "<B CLASS=STBLabel>Methods:</B> interface java.io.Closeable";
-
FLUSHABLE_M
protected static final java.lang.String FLUSHABLE_M
Label for methods inherited from classjava.io.Flushable
Checker MethodFLUSHABLE_M(Method)
matches method named:"flush"
- See Also:
FLUSHABLE_M(Method)
, Constant Field Values- Code:
- Exact Field Declaration Expression:
protected static final String FLUSHABLE_M = "<B CLASS=STBLabel>Methods:</B> interface java.io.Flushable";
-
WRITER_M
protected static final java.lang.String WRITER_M
Label for methods inherited from classjava.io.Writer
Checker MethodWRITER_M(Method)
matches method named:"write", "close", "flush", "append"
- See Also:
WRITER_M(Method)
, Constant Field Values- Code:
- Exact Field Declaration Expression:
protected static final String WRITER_M = "<B CLASS=STBLabel>Methods:</B> class java.io.Writer";
-
PRINTSTREAM_M
protected static final java.lang.String PRINTSTREAM_M
Label for methods inherited from classjava.io.PrintStream
Checker MethodPRINTSTREAM_M(Method)
matches method named:"print", "println", "printf", "format"
- See Also:
PRINTSTREAM_M(Method)
, Constant Field Values- Code:
- Exact Field Declaration Expression:
protected static final String PRINTSTREAM_M = "<B CLASS=STBLabel>Methods:</B> class java.io.PrintStream";
-
REPLACEABLE_M
protected static final java.lang.String REPLACEABLE_M
Label for methods inherited from classReplaceable
Checker MethodREPLACEABLE_M(Method)
matches method-names of all the methods currently listed inReplaceable
. Review the methods listed in that class to review those method-names.- See Also:
REPLACEABLE_M(Method)
, Constant Field Values- Code:
- Exact Field Declaration Expression:
protected static final String REPLACEABLE_M = "<B CLASS=STBLabel>Methods:</B> interface Torello.HTML.Replaceable";
-
SERIALIZABLE_F
protected static final java.lang.String SERIALIZABLE_F
Label for fields inherited from interfacejava.io.Serializable
- See Also:
- Constant Field Values
- Code:
- Exact Field Declaration Expression:
protected static final String SERIALIZABLE_F = "Serializable ID";
-
SINGLETON_F
protected static final java.lang.String SINGLETON_F
Label for fields that arestatic
singleton instances of a class.- See Also:
- Constant Field Values
- Code:
- Exact Field Declaration Expression:
protected static final String SINGLETON_F = "Singleton Instance";
-
ONLY_SERIALIZABLE_F
protected static java.lang.String[] ONLY_SERIALIZABLE_F
A Section-TitlesString[]
Array List containing only one category. The category is for Field Summaries having only one field -'serialVersionUID'
- See Also:
ONLY_SERIALIZABLE_F(Field)
- Code:
- Exact Field Declaration Expression:
protected static String[] ONLY_SERIALIZABLE_F = { SERIALIZABLE_F };
-
EXCEPTION_CONVENIENCE_F
protected static java.lang.String[] EXCEPTION_CONVENIENCE_F
A Section-TitlesString[]
Array List containing two categories. The first merely used for theserialVersionUID
, and the second contains all other fields. This is intended to be used for sortingException
classes that provide "convenience" or "introspection" fields where data about the error that has occured is saved inside the exception.- See Also:
EXCEPTION_CONVENIENCE_F(Field)
- Code:
- Exact Field Declaration Expression:
protected static String[] EXCEPTION_CONVENIENCE_F = { SERIALIZABLE_F, "<CODE STYLE='font-size: 108%'>'final'</CODE> Exception Convenience Fields" };
-
EXCEPTION_CHECKERS_M
protected static java.lang.String[] EXCEPTION_CHECKERS_M
If anException
class contains 'checker' methods, then this title-barString[]
Array can be used to categorize them. Note that this array only allows for this lone-category, and does not provide others. The sorter for this Titles-Bar requires that each method in the class have a name that begins with'check'
- See Also:
EXCEPTION_CHECKERS_M(Method)
- Code:
- Exact Field Declaration Expression:
protected static String[] EXCEPTION_CHECKERS_M = { "<CODE STYLE='font-size: 108%'>'static'</CODE> Exception Check Methods" };
-
VALUES_M
protected static final java.lang.String VALUES_M
First Section-Title / Category for the Synthetic Enum-Method'values()'
. All'enums'
have a'values'
method that is auto-generated by the Java Compiler.- See Also:
enum$M$Sections
,enum2$M$Sections
, Constant Field Values- Code:
- Exact Field Declaration Expression:
protected static final String VALUES_M = "List all Enum Constants";
-
VALUEOF_M
protected static final java.lang.String VALUEOF_M
Second Section-Title / Category for the Synthetic Enum-Method'valueOf(String)'
. All'enums'
have a'valueOf'
method that is auto-generated by the Java Compiler.- See Also:
enum$M$Sections
,enum2$M$Sections
, Constant Field Values- Code:
- Exact Field Declaration Expression:
protected static final String VALUEOF_M = "Convert String to Enum Constant";
-
enum$M$Sections
protected static java.lang.String[] enum$M$Sections
Section Titles for the Synthetic Methods, the ones which are auto-generated by Java, of all declared'enum'
types. ThisString[]
Array should be used when there the only methods listed on the Java Doc HTML Page are the two synthetically generated methods.
If you have written additional functions, then you should useenum2$M$Sections
, because thatString[]
Array has an extra Category / Section-Title called "More Methods".- See Also:
VALUEOF_M
,VALUES_M
,enum$M$Sorter(Torello.JavaDoc.Method)
- Code:
- Exact Field Declaration Expression:
protected static String[] enum$M$Sections = { VALUEOF_M, VALUES_M };
-
enum2$M$Sections
protected static java.lang.String[] enum2$M$Sections
Section Titles for the Synthetic Methods, the ones which are auto-generated by Java, of all declared'enum'
types. ThisString[]
Array should be used when there the only methods listed on the Java Doc HTML Page are the two synthetically generated methods.
If yourenum
only has these two synthetic-Java methods, then you should useenum$M$Sections
.- See Also:
VALUEOF_M
,VALUES_M
,enum2$M$Sorter(Torello.JavaDoc.Method)
- Code:
- Exact Field Declaration Expression:
protected static String[] enum2$M$Sections = { VALUEOF_M, VALUES_M, "More Methods" };
-
STATIC_FACTORY
protected static final java.lang.String STATIC_FACTORY
Title-Category for methods that are'static'
Factory Methods.- See Also:
- Constant Field Values
- Code:
- Exact Field Declaration Expression:
protected static final String STATIC_FACTORY = "<B CLASS=STBLabel>Methods:</B> Static Factory-Builder";
-
DEFAULT_COMP
protected static final java.lang.String DEFAULT_COMP
Title-Category for composition methods (for instance'andThen'
)- See Also:
- Constant Field Values
- Code:
- Exact Field Declaration Expression:
protected static final String DEFAULT_COMP = "<B CLASS=STBLabel>Methods:</B> Default Composition & Builder";
-
DEF_ITER_REMOVE
protected static final java.lang.String DEF_ITER_REMOVE
Iterator.remove()
Method Title-Category.- See Also:
- Constant Field Values
- Code:
- Exact Field Declaration Expression:
protected static final String DEF_ITER_REMOVE = "<B CLASS=STBLabel>Default Methods:</B> Remove Elements with Iterator.remove()";
-
fInterface$M$Sections
protected static final java.lang.String[] fInterface$M$Sections
A "Section Titles"String[]
Array that contains only one Title/Category. This category identifies a Functional-Interface's Lambda-Target method.- See Also:
FINTERFACE_M
- Code:
- Exact Field Declaration Expression:
protected static final String[] fInterface$M$Sections = { FINTERFACE_M };
-
-
Constructor Detail
-
SummarySorterHelper
public SummarySorterHelper()
-
-
Method Detail
-
UE
protected static UnreachableError UE(Declaration d)
When writing a sorter method, it is often a good practice to throw theUnreachableError
on the very last line of the sorter's code to ensure that every entity being sorted has been properly placed into one of the Table Of Contents Section Title Categories. This way, you ever add a new method / field / entity to the class, but forget to categorize it under a specific Section Title, anUnreachableError
will instantly throw, reminding you to sort your newly created method, field, or other entity.
The other primary reason for writing this method is to shorten the amount of typing that you need to do. The below example sorts all of the methods in a class into a Method Summary Section (on the JavaDoc Generated HTML Page) which has three Sections each with their own Title. The Titles, themselves, are listed in theString[]
array. The sorting method for placing method's into one of these three Section Categories is directly beneath the listed categories.
Notice in this example, the last line of code invokes this method ("UE(Declaration d)"
)
Example:
public static final String[] MyClass$Method$Sections = { "Main Method", "Printing Methods", "File Saving Methods" }; public static int MyClass$Method$Sorter(Method m) { if (m.name.equals("someName1")) return 0; if (eqOR(m, "someName2", "someName3")) return 1; if (swOR(m, "someName3")) return 2; throw UE(m); // <== RIGHT-HERE, if the method is not categorized, it would have to be // becuase you have added another method into the class. This will halt // your build process until you update your Method-Sorter Function. }
- Parameters:
d
- Any Declaration (Method
,Field
,Constructor
, etc...). This is actually just supposed to be the entity that was passed to your sorter. If a call to'UE(d)'
is made one the last line of your sorter-function, the'toString'
method for the declaration will be printed to the terminal.- Returns:
- This returns a newly created instance of
UnreachableError
, which may be immediately thrown. Remember, the general idea behind this method is to shorten the amount of typing you (the user / programmer) has to do. When writing Class "Entity Sorters", you will find yourself typing many short sorting methods, like in the example above, over and over again. - Code:
- Exact Method Body:
System.out.println( '\n' + // Messager.Quiet && Messager.Silent needs this BRED + "Un Classified " + d.getClass().getSimpleName() + " Found:\n" + RESET + d.toString(PF.BODY | PF.JOW_ALSO | PF.UNIX_COLORS) ); return new UnreachableError();
-
eqOR
protected static boolean eqOR(Declaration d, java.lang.String... sArr)
An "Abbreviation Method" for reducing the amount of typing that needs to happen. Checks the name of the passedDeclaration
parameter against a list of possible matches.
Returns the result of callingStrCmpr.equalsXOR
on fieldDeclaration.name
, against the elements of parameter'sArr'
.- Parameters:
d
- AnyMethod
,Field
,Constructor
etc.sArr
- A list of names for theMethod
,Field
,Constructor
etc..., that is passed to parameter'd'
. If the fieldDeclaration.name
is aString
thatEquals
any one of the elements of parameter'sArr'
, then this method shall returnTRUE
, otherwiseFALSE
is returned.- Returns:
TRUE
- if and only ifd.name
Equals
one of the elements of'sArr'
- See Also:
StrCmpr.equalsXOR(String, String[])
- Code:
- Exact Method Body:
return StrCmpr.equalsXOR(d.name, sArr);
-
cOR
protected static boolean cOR(Declaration d, java.lang.String... sArr)
An "Abbreviation Method" for reducing the amount of typing that needs to happen. Checks the name of the passedDeclaration
parameter against a list of possible matches.
Returns the result of callingStrCmpr.containsOR
on fieldDeclaration.name
, against the elements of parameter'sArr'
.- Parameters:
d
- AnyMethod
,Field
,Constructor
etc.sArr
- A list of names for theMethod
,Field
,Constructor
etc..., that is passed to parameter'd'
. If the fieldDeclaration.name
is aString
thatContains
any one of the elements of parameter'sArr'
, then this method shall returnTRUE
, otherwiseFALSE
is returned.- Returns:
TRUE
- if and only ifd.name
Contains
one of the elements of'sArr'
- See Also:
StrCmpr.containsOR(String, String[])
- Code:
- Exact Method Body:
return StrCmpr.containsOR(d.name, sArr);
-
swOR
protected static boolean swOR(Declaration d, java.lang.String... sArr)
An "Abbreviation Method" for reducing the amount of typing that needs to happen. Checks the name of the passedDeclaration
parameter against a list of possible matches.
Returns the result of callingStrCmpr.startsWithXOR
on fieldDeclaration.name
, against the elements of parameter'sArr'
.- Parameters:
d
- AnyMethod
,Field
,Constructor
etc.sArr
- A list of names for theMethod
,Field
,Constructor
etc..., that is passed to parameter'd'
. If the fieldDeclaration.name
is aString
thatStarts-With
any one of the elements of parameter'sArr'
, then this method shall returnTRUE
, otherwiseFALSE
is returned.- Returns:
TRUE
- if and only ifd.name
Starts-With
one of the elements of'sArr'
- See Also:
StrCmpr.startsWithXOR(String, String[])
- Code:
- Exact Method Body:
return StrCmpr.startsWithXOR(d.name, sArr);
-
ewOR
protected static boolean ewOR(Declaration d, java.lang.String... sArr)
An "Abbreviation Method" for reducing the amount of typing that needs to happen. Checks the name of the passedDeclaration
parameter against a list of possible matches.
Returns the result of callingStrCmpr.endsWithXOR
on fieldDeclaration.name
, against the elements of parameter'sArr'
.- Parameters:
d
- AnyMethod
,Field
,Constructor
etc.sArr
- A list of names for theMethod
,Field
,Constructor
etc..., that is passed to parameter'd'
. If the fieldDeclaration.name
is aString
thatEnds-With
any one of the elements of parameter'sArr'
, then this method shall returnTRUE
, otherwiseFALSE
is returned.- Returns:
TRUE
- if and only ifd.name
Ends-With
one of the elements of'sArr'
- See Also:
StrCmpr.endsWithXOR(String, String[])
- Code:
- Exact Method Body:
return StrCmpr.endsWithXOR(d.name, sArr);
-
OBJECT_M
protected static boolean OBJECT_M(Method m)
Identifies whether or not a particular method should be placed under the Method Summary Section Title for methods which implement or extendjava.lang.Object
.- Parameters:
m
- This is the actualmethod
, as an instance ofTorello.HTML.Tools.JavaDoc.Method
, that needs to be sorterd into a Class/Interface/Enum... "Summary Section-Title" Category. The boolean returned by this method merely indicates whether or not this method-parameter should be placed into theObject Method's
Section-Category.
Again, the primary impetus for writing this class is to help save time and eliminate all of the tedium of that would be caused by retyping these lines over and over.- Returns:
TRUE
if the parameter'm'
should be placed into the Section Title Category forObject
, andFALSE
otherwise.- See Also:
OBJECT_M
,StrCmpr.equalsXOR(String, String[])
- Code:
- Exact Method Body:
return StrCmpr.equalsXOR(m.name, "hashCode", "toString", "equals");
-
ITERATOR_M
protected static boolean ITERATOR_M(Method m)
Identifies whether or not a particular method should be placed under the Method Summary Section Title for methods which implement or extendjava.util.Iterator
.- Parameters:
m
- This is the actualmethod
, as an instance ofTorello.HTML.Tools.JavaDoc.Method
, that needs to be sorterd into a Class/Interface/Enum... "Summary Section-Title" Category. The boolean returned by this method merely indicates whether or not this method-parameter should be placed into theIterator Method's
Section-Category.
Again, the primary impetus for writing this class is to help save time and eliminate all of the tedium of that would be caused by retyping these lines over and over.- Returns:
TRUE
if the parameter'm'
should be placed into the Section Title Category forIterator
, andFALSE
otherwise.- See Also:
ITERATOR_M
,StrCmpr.equalsXOR(String, String[])
- Code:
- Exact Method Body:
return StrCmpr.equalsXOR(m.name, "next", "hasNext", "remove", "forEachRemaining");
-
CLONEABLE_M
protected static boolean CLONEABLE_M(Method m)
Identifies whether or not a particular method should be placed under the Method Summary Section Title for methods which implement or extendjava.lang.Cloneable
.- Parameters:
m
- This is the actualmethod
, as an instance ofTorello.HTML.Tools.JavaDoc.Method
, that needs to be sorterd into a Class/Interface/Enum... "Summary Section-Title" Category. The boolean returned by this method merely indicates whether or not this method-parameter should be placed into theCloneable Method's
Section-Category.
Again, the primary impetus for writing this class is to help save time and eliminate all of the tedium of that would be caused by retyping these lines over and over.- Returns:
TRUE
if the parameter'm'
should be placed into the Section Title Category forCloneable
, andFALSE
otherwise.- See Also:
CLONEABLE_M
- Code:
- Exact Method Body:
return m.name.equals("clone");
-
APPENDABLE_M
protected static boolean APPENDABLE_M(Method m)
Identifies whether or not a particular method should be placed under the Method Summary Section Title for methods which implement or extendjava.lang.Appendable
.- Parameters:
m
- This is the actualmethod
, as an instance ofTorello.HTML.Tools.JavaDoc.Method
, that needs to be sorterd into a Class/Interface/Enum... "Summary Section-Title" Category. The boolean returned by this method merely indicates whether or not this method-parameter should be placed into theAppendable Method's
Section-Category.
Again, the primary impetus for writing this class is to help save time and eliminate all of the tedium of that would be caused by retyping these lines over and over.- Returns:
TRUE
if the parameter'm'
should be placed into the Section Title Category forAppendable
, andFALSE
otherwise.- See Also:
APPENDABLE_M
- Code:
- Exact Method Body:
return m.name.equals("append");
-
COMPARABLE_M
protected static boolean COMPARABLE_M(Method m)
Identifies whether or not a particular method should be placed under the Method Summary Section Title for methods which implement or extendjava.lang.Comparable
.- Parameters:
m
- This is the actualmethod
, as an instance ofTorello.HTML.Tools.JavaDoc.Method
, that needs to be sorterd into a Class/Interface/Enum... "Summary Section-Title" Category. The boolean returned by this method merely indicates whether or not this method-parameter should be placed into theComparable Method's
Section-Category.
Again, the primary impetus for writing this class is to help save time and eliminate all of the tedium of that would be caused by retyping these lines over and over.- Returns:
TRUE
if the parameter'm'
should be placed into the Section Title Category forComparable
, andFALSE
otherwise.- See Also:
COMPARABLE_M
- Code:
- Exact Method Body:
return m.name.equals("compareTo");
-
CHARSEQUENCE_M
protected static boolean CHARSEQUENCE_M(Method m)
Identifies whether or not a particular method should be placed under the Method Summary Section Title for methods which implement or extendjava.lang.CharSequence
.- Parameters:
m
- This is the actualmethod
, as an instance ofTorello.HTML.Tools.JavaDoc.Method
, that needs to be sorterd into a Class/Interface/Enum... "Summary Section-Title" Category. The boolean returned by this method merely indicates whether or not this method-parameter should be placed into theCharSequence Method's
Section-Category.
Again, the primary impetus for writing this class is to help save time and eliminate all of the tedium of that would be caused by retyping these lines over and over.- Returns:
TRUE
if the parameter'm'
should be placed into the Section Title Category forCharSequence
, andFALSE
otherwise.- See Also:
CHARSEQUENCE_M
,StrCmpr.equalsXOR(String, String[])
- Code:
- Exact Method Body:
return StrCmpr.equalsXOR(m.name, "toString", "subSequence", "charAt", "length");
-
CLOSEABLE_M
protected static boolean CLOSEABLE_M(Method m)
Identifies whether or not a particular method should be placed under the Method Summary Section Title for methods which implement or extendjava.io.Closeable
.- Parameters:
m
- This is the actualmethod
, as an instance ofTorello.HTML.Tools.JavaDoc.Method
, that needs to be sorterd into a Class/Interface/Enum... "Summary Section-Title" Category. The boolean returned by this method merely indicates whether or not this method-parameter should be placed into theCloseable Method's
Section-Category.
Again, the primary impetus for writing this class is to help save time and eliminate all of the tedium of that would be caused by retyping these lines over and over.- Returns:
TRUE
if the parameter'm'
should be placed into the Section Title Category forCloseable
, andFALSE
otherwise.- See Also:
CLOSEABLE_M
- Code:
- Exact Method Body:
return m.name.equals("close") && m.returnType.equals("void");
-
FLUSHABLE_M
protected static boolean FLUSHABLE_M(Method m)
Identifies whether or not a particular method should be placed under the Method Summary Section Title for methods which implement or extendjava.io.Flushable
.- Parameters:
m
- This is the actualmethod
, as an instance ofTorello.HTML.Tools.JavaDoc.Method
, that needs to be sorterd into a Class/Interface/Enum... "Summary Section-Title" Category. The boolean returned by this method merely indicates whether or not this method-parameter should be placed into theFlushable Method's
Section-Category.
Again, the primary impetus for writing this class is to help save time and eliminate all of the tedium of that would be caused by retyping these lines over and over.- Returns:
TRUE
if the parameter'm'
should be placed into the Section Title Category forFlushable
, andFALSE
otherwise.- See Also:
FLUSHABLE_M
- Code:
- Exact Method Body:
return m.name.equals("flush") && m.returnType.equals("void");
-
WRITER_M
protected static boolean WRITER_M(Method m)
Identifies whether or not a particular method should be placed under the Method Summary Section Title for methods which implement or extendjava.io.Writer
.- Parameters:
m
- This is the actualmethod
, as an instance ofTorello.HTML.Tools.JavaDoc.Method
, that needs to be sorterd into a Class/Interface/Enum... "Summary Section-Title" Category. The boolean returned by this method merely indicates whether or not this method-parameter should be placed into theWriter Method's
Section-Category.
Again, the primary impetus for writing this class is to help save time and eliminate all of the tedium of that would be caused by retyping these lines over and over.- Returns:
TRUE
if the parameter'm'
should be placed into the Section Title Category forWriter
, andFALSE
otherwise.- See Also:
WRITER_M
,StrCmpr.equalsXOR(String, String[])
- Code:
- Exact Method Body:
return StrCmpr.equalsXOR(m.name, "write", "close", "flush", "append");
-
PRINTSTREAM_M
protected static boolean PRINTSTREAM_M(Method m)
Identifies whether or not a particular method should be placed under the Method Summary Section Title for methods which implement or extendjava.io.PrintStream
.- Parameters:
m
- This is the actualmethod
, as an instance ofTorello.HTML.Tools.JavaDoc.Method
, that needs to be sorterd into a Class/Interface/Enum... "Summary Section-Title" Category. The boolean returned by this method merely indicates whether or not this method-parameter should be placed into thePrintStream Method's
Section-Category.
Again, the primary impetus for writing this class is to help save time and eliminate all of the tedium of that would be caused by retyping these lines over and over.- Returns:
TRUE
if the parameter'm'
should be placed into the Section Title Category forPrintStream
, andFALSE
otherwise.- See Also:
PRINTSTREAM_M
,StrCmpr.equalsXOR(String, String[])
- Code:
- Exact Method Body:
return StrCmpr.equalsXOR(m.name, "print", "println", "printf", "format");
-
REPLACEABLE_M
protected static boolean REPLACEABLE_M(Method m)
Identifies whether or not a particular method should be placed under the Method Summary Section Title for methods which implement or extendReplaceable
.- Parameters:
m
- This is the actualmethod
, as an instance ofTorello.HTML.Tools.JavaDoc.Method
, that needs to be sorterd into a Class/Interface/Enum... "Summary Section-Title" Category. The boolean returned by this method merely indicates whether or not this method-parameter should be placed into theReplaceable Method's
Section-Category.
Again, the primary impetus for writing this class is to help save time and eliminate all of the tedium of that would be caused by retyping these lines over and over.- Returns:
TRUE
if the parameter'm'
should be placed into the Section Title Category forReplaceable
, andFALSE
otherwise.- See Also:
REPLACEABLE_M
- Code:
- Exact Method Body:
return REPLACEABLE_METHODS.contains(m.name);
-
SERIALIZABLE_F
protected static boolean SERIALIZABLE_F(Field f)
Checks if aField
is named'serialVersionUID'
.- See Also:
SERIALIZABLE_F
- Code:
- Exact Method Body:
return f.name.equals("serialVersionUID");
-
ONLY_SERIALIZABLE_F
protected static int ONLY_SERIALIZABLE_F(Field f)
A sorter for Field Summaries with only one field -'serialVersionUID'
- Throws:
UnreachableError
- If there are other fields in the class.- See Also:
ONLY_SERIALIZABLE_F
- Code:
- Exact Method Body:
if (SERIALIZABLE_F(f)) return 0; throw UE(f);
-
EXCEPTION_CONVENIENCE_F
protected static int EXCEPTION_CONVENIENCE_F(Field f)
This can be used to sort theField's
of an exception, provided that they fields obey the convenience-construct. This sorter will place the'serialVersionUID'
field into the first category, and all other fields into the second.
It is assumed that the convenience-fields are declaredfinal
. If a field is not declared'final'
, it will not be categorized, and anUnreachableError
will throw.- Parameters:
f
- This is theField
that the Java Doc Upgrader is currently categorizing.- Throws:
UnreachableError
- If there are other fields in the class besides the Serial ID, and fields which aren't declared'final'
- See Also:
EXCEPTION_CONVENIENCE_F
- Code:
- Exact Method Body:
if (SERIALIZABLE_F(f)) return 0; if (f.modifiers.contains("final")) return 1; throw UE(f);
-
EXCEPTION_CHECKERS_M
protected static int EXCEPTION_CHECKERS_M(Method m)
Sorts a Method Summary Section for anException
class that contains 'checker' methods. In Java HTML,'check'
methods are declared'static'
, and will test parameter-input for exception cases, and then throw the exception in which those methods reside if there are errors with the input.
NOTE: See, for exampleParallelArrayException
, which contains multiple methods of this variety.- Parameters:
m
- This is theMethod
that the Java Doc Upgrader is currently categorizing.- Throws:
UnreachableError
- If there are methods which aren't declared'static'
, or there are methods whose name does not begin with"check"
.- See Also:
EXCEPTION_CHECKERS_M
- Code:
- Exact Method Body:
if (m.name.startsWith("check") && m.modifiers.contains("static")) return 0; throw UE(m);
-
enum$M$Sorter
protected static int enum$M$Sorter(Method m)
Sorts anenum's
methods (in the Java Doc 'Method Summary') into the Categories / Section-Titles provided byenum$M$Sections
.
NOTE: If the'enum'
whose methods you are sorting has other methods besides the ones auto-created by the Java Compiler, you should use the pairenum2$M$Sections
andenum2$M$Sorter(Method)
. This one will throw anUnreachableError
if other methods are received.- Parameters:
m
- This is theMethod
that the Java Doc Upgrader is currently categorizing.- Returns:
- The category number where this method belongs.
- Throws:
UnreachableError
- If the'enum'
to which this Method Summary-Sorter has been applied has methods other than the Synthetically auto-generated methods'values'
and'valueOf'
, then when those methods are received by this sorter, this error will throw.- See Also:
enum$M$Sections
- Code:
- Exact Method Body:
if (m.name.equals("valueOf")) return 0; if (m.name.equals("values")) return 1; throw UE(m);
-
enum2$M$Sorter
protected static int enum2$M$Sorter(Method m)
Sorts anenum's
methods (in the Java Doc 'Method Summary') into the Categories / Section-Titles provided byenum2$M$Sections
.- Parameters:
m
- This is theMethod
that the Java Doc Upgrader is currently categorizing.- Returns:
- The category number where this method belongs.
- See Also:
enum2$M$Sections
- Code:
- Exact Method Body:
if (m.name.equals("valueOf")) return 0; if (m.name.equals("values")) return 1; return 2;
-
fInterface$M$Sorter
protected static int fInterface$M$Sorter (java.lang.String functionalIntMethName, Method m)
This can be used to place a functional-interface method under the sectional title for functional-interfaces. This method will only work on interfaces that have only method (namely: the lambda-target method).- Parameters:
functionalIntMethName
- This is the name of the 'lone method' that is used as a lambda-target of aFunctionalInterface
.m
- This is theMethod
that the Java Doc Upgrader is currently categorizing.- Throws:
UnreachableError
- If there are other methods in the class besides the one whose name equals'functionalIntMethName'
- Code:
- Exact Method Body:
if (m.name.equals(functionalIntMethName)) return 0; throw UE(m);
-
-