Package Torello.JavaDoc
Class JavaDocHTMLFile
- java.lang.Object
-
- Torello.JavaDoc.ParsedFile
-
- Torello.JavaDoc.JavaDocHTMLFile
-
- All Implemented Interfaces:
java.io.Serializable
public final class JavaDocHTMLFile extends ParsedFile implements java.io.Serializable
Optional-Extension Class of a Basic-Upgrade:
Running a Standard-Upgrade on a Java-Doc Web-Page Directory-Tree only requires building an instance of classUpgrade
, and executing itsupgrade()
method!
The Standard-Upgrade Process will insert CSS-Tags, Hi-Lite Properly-Marked Code-Snippet<DIV>'s
, Hi-Lite all Method-Bodies & Field-Declarations, and even create Navigation-Menu Links. If more fine-grained control is needed, this class provides direct access to the Java Doc Web-Page HTML.
Accessing this Class:
This class may be accessed by utilizing a configuration method in classUpgrade
, specifically calling:
Upgrade.setExtraTasks(Consumer<JavaDocHTMLFile> handler)
... with a handler (ajava.util.function.Consumer
instance) that receives aJavaDocHTMLFile
instance.
ClassJavaDocHTMLFile
provides access to every HTML Component on a Java-Doc Web-Page. If programmatic changes to a Java-Doc Web-Page are needed, these Reflection-API classes make it easy to change, update, remove & add-to the HTML on these pages. Simply registering a handler with theUpgrader
, make the necessary improvements, and they will be incorporated into the final-output HTML-Page.
Again, classJavaDocHTMLFile
has getters for:HeaderFooterHTML
,SummaryTableHTML
andReflHTML
Alternatively:
Creating an instance of one of the two offered "User-Processor" classes - both of which have several listener/handler methods - is also a great way to access the Reflection-HTML API. These two Java Interfaces are:
Retains all information parsed from a'.html'
Java-Doc web-page, and borrows any missing information that was found in the'.java'
source-code file; note that an instance-reference of this class may be rerieved, and used, to further change a Java Doc page by registering a visitor-handler with the configuration classUpgrade
by callingUpgrade.setExtraTasks(Consumer)
.This Class May be Used to Programmatically Modify JavaDoc HTML
Modifying JavaDoc HTML can be done using:JavaDocHTMLFile
,SummaryTableHTML
,ReflHTML
andHeaderFooterHTML
.
To get instances of these classes, just register a listener with the Upgrader using:Upgrade.setExtraTasks
This is optional, as the Standard Upgrader-Features do not necessitate use of this class.
This class is used to "Parse" an already vectorized-html web-page that is, specifically, a page that was generated by the Java-Doc HTML code-documentation page-generator tool. This class works in tandem with theclass JavaSourceCodeFile
which uses the more advanced 'Java Parser' tool to parse'.java'
source-code files into lists of method, constructor and field definitions. The features of both of these classes is similar to the features that Java's "Reflection A.P.I." offers:class JavaSourceCodeFile
- Parses'.java'
Source-Code Filesclass JavaDocHTMLFile
- Extracts Method, Constructor & Field Info from'.html'
javadoc files.
This class, which is the second listed in the above list, simply retrieves the method names, constructor names and method-types (and constructor-types, etc...). With this information encapsulated in string-format, the internal JavaDoc Upgrader can find additional information that the original javadoc tool (written in the 1990's) does not include in the output documentation web-pages. The primary point to remember about this class, though, is that in order to "insert / update" more information into the output'.html'
web-page files, the information which comes from the'.java'
source-code files needs to do some work to be able to "automatically map" a method, constructor, or field definition on a documentation page with the same method, constructor or field defined in the source-code file. In order to do this, both files need to have their lists of these things parsed and converted into something simple and manageable. This class parses the "web-page.html
files." The other class -'JavaSourceCodeFile'
- parses'.java'
files and builds the exact same lists ofString's
so that both files may be matched.
In order to retrieve JavaMethod
andConstructor
bodies asString's
- and perform the syntax hiliting needed to insert them into the JavaDoc Web-Pages, both of these parsers are needed to do an upgrade.- See Also:
JavaSourceCodeFile
, Serialized Form
Hi-Lited Source-Code:- View Here: Torello/JavaDoc/JavaDocHTMLFile.java
- Open New Browser-Tab: Torello/JavaDoc/JavaDocHTMLFile.java
-
-
Field Summary
Serializable ID Modifier and Type Field static long
serialVersionUID
Relative Path-String ( '../../'
) to Root JavaDoc DirectoryModifier and Type Field String
dotDots
JavaDoc Page Header & Footer HTML (NavBars, Inheritance-Tree, Signature, etc) Modifier and Type Field HeaderFooterHTML
headerFooter
Parsed Summary-Tables' HTML Modifier and Type Field SummaryTableHTML<Constructor>
constructorSummaryTable
SummaryTableHTML<EnumConstant>
ecSummaryTable
SummaryTableHTML<Field>
fieldSummaryTable
SummaryTableHTML<Method>
methodSummaryTable
SummaryTableHTML<NestedType>
ntSummaryTable
SummaryTableHTML<AnnotationElem>
oaeSummaryTable
SummaryTableHTML<AnnotationElem>
raeSummaryTable
Final Booleans Indicating User-Requested Details Removal Modifier and Type Field boolean
aeDetailsRemoved
boolean
constructorDetailsRemoved
boolean
ecDetailsRemoved
boolean
fieldDetailsRemoved
boolean
methodDetailsRemoved
Relative Path URL
to Source-As-HTML FilesModifier and Type Field String
hiLitedSrcFileURL
String
srcAsHTMLFileURL
-
Fields inherited from class Torello.JavaDoc.ParsedFile
annotationElems, annotationsMirror, ciet, constructors, containerClasses, endLineNumber, enumConstants, fields, fileName, fullyQualifiedName, genericParameters, isGeneric, isInner, javaSrcFileAsStr, jdEndLineNumber, jdStartLineNumber, methods, name, nestedTypes, packageName, simpleName, startLineNumber, typeLineCount, typeSizeChars
-
-
Method Summary
Retrieve an Iterator of the Summary Tables found on a Java Doc Web-Page Modifier and Type Method Iterator<SummaryTableHTML>
allNonNullSummaryTables()
Stream<SummaryTableHTML>
allNonNullSummaryTablesStream()
Retrieve a Stream of the Details-Entities ( ReflHTML
) found on this Java Doc Web-PageModifier and Type Method Stream<ReflHTML<AnnotationElem>>
allAEDetails()
Stream<ReflHTML<Constructor>>
allConstructorDetails()
Stream<ReflHTML<EnumConstant>>
allECDetails()
Stream<ReflHTML<Field>>
allFieldDetails()
Ret2<TreeSet<String>,
TreeSet<String>>allIDsAndHREFs()
Stream<ReflHTML<Method>>
allMethodDetails()
Retrieve an Iterator of the Details-Entites ( ReflHTML
) found on this Java Doc Web-PageModifier and Type Method Iterator<ReflHTML<AnnotationElem>>
aeDetailsIterator()
Iterator<ReflHTML<Constructor>>
constructorDetailsIterator()
Iterator<ReflHTML<EnumConstant>>
ecDetailsIterator()
Iterator<ReflHTML<Field>>
fieldDetailsIterator()
Iterator<ReflHTML<Method>>
methodDetailsIterator()
Use a Predicate to find Reflected-HTML ( ReflHTML
) instancesModifier and Type Method Stream<ReflHTML<AnnotationElem>>
findAEHTML(Predicate<AnnotationElem> finder)
Stream<ReflHTML<Constructor>>
findConstructorHTML(Predicate<Constructor> finder)
Stream<ReflHTML<EnumConstant>>
findECHTML(Predicate<EnumConstant> finder)
Stream<ReflHTML<Field>>
findFieldHTML(Predicate<Field> finder)
Stream<ReflHTML<Method>>
findMethodHTML(Predicate<Method> finder)
Find specific Reflected-HTML ( ReflHTML
) instancesModifier and Type Method ReflHTML<AnnotationElem>
findAEHTML(String annotationElemName)
Stream<ReflHTML<Constructor>>
findConstructorHTML(int numParameters)
ReflHTML<EnumConstant>
findECHTML(String enumConstantName)
ReflHTML<Field>
findFieldHTML(String fieldName)
Stream<ReflHTML<Method>>
findMethodHTML(int numParameters)
Stream<ReflHTML<Method>>
findMethodHTML(String methodName)
<ENTITY extends Declaration>
ReflHTML<ENTITY>findReflHTML(int declarationID, Class<ENTITY> c)
-
Methods inherited from class Torello.JavaDoc.ParsedFile
abbreviatedSummary, addAnnotationElem, addConstructor, addEnumConstant, addField, addMethod, addNestedType, diff, findAnnotationElem, findConstructors, findEnumConstant, findField, findMethods, findNestedType, getAnnotationElem, getAnnotationElems, getAnnotationElems, getConstructor, getConstructors, getConstructors, getContainerClasses, getEnumConstant, getEnumConstants, getEnumConstants, getField, getFields, getFields, getGenericParameters, getMethod, getMethods, getMethods, getNestedType, getNestedTypes, getNestedTypes, numAnnotationElems, numConstructors, numEnumConstants, numFields, numMethods, numNestedTypes, quickSummary, toString, toString
-
-
-
-
Field Detail
-
serialVersionUID
public static final long serialVersionUID
This fulfils the SerialVersion UID requirement for all classes that implement Java'sinterface java.io.Serializable
. Using theSerializable
Implementation offered by java is very easy, and can make saving program state when debugging a lot easier. It can also be used in place of more complicated systems like "hibernate" to store data as well.- See Also:
- Constant Field Values
- Code:
- Exact Field Declaration Expression:
public static final long serialVersionUID = 1;
-
dotDots
public final java.lang.String dotDots
This provides the relative path-String
from'this'
Java Doc generated HTML File to the root Java Doc directory.- Code:
- Exact Field Declaration Expression:
public final String dotDots;
-
headerFooter
public final HeaderFooterHTML headerFooter
The HTML that occurs directly above the Summary-Tables is the header. The HTML that is located below the Detail-Entries is the footer.- Code:
- Exact Field Declaration Expression:
public final HeaderFooterHTML headerFooter;
-
srcAsHTMLFileURL
public final java.lang.String srcAsHTMLFileURL
This is the File-URL
to use if a need to link to the corresponding"/src-html/"
file is necessary.
This is a relative-URL that contains the requisite number of 'dot-dots' to reach the file from the location where this Java Doc HTML File is located.- Code:
- Exact Field Declaration Expression:
public final String srcAsHTMLFileURL;
-
hiLitedSrcFileURL
public final java.lang.String hiLitedSrcFileURL
This is the File-URL
to use if a need to link to the corresponding"/hilite-files/"
file is necessary.
This is a relative-URL that is relative to the file from the location where this Java Doc HTML File is located. Specifically, thisString
begins with the text"/hilite-files/"
, followed by the type-name, and ending with the extension".java.html"
- Code:
- Exact Field Declaration Expression:
public final String hiLitedSrcFileURL;
-
methodSummaryTable
public final SummaryTableHTML<Method> methodSummaryTable
The HTML for a Method Summary- Code:
- Exact Field Declaration Expression:
public final SummaryTableHTML<Method> methodSummaryTable;
-
fieldSummaryTable
public final SummaryTableHTML<Field> fieldSummaryTable
The HTML for a Field Summary Table- Code:
- Exact Field Declaration Expression:
public final SummaryTableHTML<Field> fieldSummaryTable;
-
constructorSummaryTable
public final SummaryTableHTML<Constructor> constructorSummaryTable
The HTML for a Constructor Summary Table- Code:
- Exact Field Declaration Expression:
public final SummaryTableHTML<Constructor> constructorSummaryTable;
-
ecSummaryTable
public final SummaryTableHTML<EnumConstant> ecSummaryTable
The HTML for an Enum-Constant Summary Table- Code:
- Exact Field Declaration Expression:
public final SummaryTableHTML<EnumConstant> ecSummaryTable;
-
oaeSummaryTable
public final SummaryTableHTML<AnnotationElem> oaeSummaryTable
The HTML for an Optional Annotation Element Summary Table- Code:
- Exact Field Declaration Expression:
public final SummaryTableHTML<AnnotationElem> oaeSummaryTable;
-
raeSummaryTable
public final SummaryTableHTML<AnnotationElem> raeSummaryTable
The HTML for a Required Annotation Element Summary Table- Code:
- Exact Field Declaration Expression:
public final SummaryTableHTML<AnnotationElem> raeSummaryTable;
-
ntSummaryTable
public final SummaryTableHTML<NestedType> ntSummaryTable
The HTML for a Nested-Class (Inner-Class) Summary Table- Code:
- Exact Field Declaration Expression:
public final SummaryTableHTML<NestedType> ntSummaryTable;
-
methodDetailsRemoved
public final boolean methodDetailsRemoved
Identifies if this Java Doc HTML Page has had it's Method Details Removed- Code:
- Exact Field Declaration Expression:
public final boolean methodDetailsRemoved;
-
constructorDetailsRemoved
public final boolean constructorDetailsRemoved
Identifies if this Java Doc HTML Page has had it's Constructor Details Removed- Code:
- Exact Field Declaration Expression:
public final boolean constructorDetailsRemoved;
-
fieldDetailsRemoved
public final boolean fieldDetailsRemoved
Identifies if this Java Doc HTML Page has had it's Field Details Removed- Code:
- Exact Field Declaration Expression:
public final boolean fieldDetailsRemoved;
-
ecDetailsRemoved
public final boolean ecDetailsRemoved
Identifies if this Java Doc HTML Page has had it's Enumeration Constant Details Removed- Code:
- Exact Field Declaration Expression:
public final boolean ecDetailsRemoved;
-
aeDetailsRemoved
public final boolean aeDetailsRemoved
Identifies if this Java Doc HTML Page has had it's Annotation-Element Details Removed- Code:
- Exact Field Declaration Expression:
public final boolean aeDetailsRemoved;
-
-
Method Detail
-
allNonNullSummaryTables
public java.util.Iterator<SummaryTableHTML> allNonNullSummaryTables()
AnIterator
that iterates the Summary Tables defined on this page.- Returns:
- An Instance of
Iterator<SummaryTableHTML>
.
NOTE: There is a raw-type used by theIterator
that is returned. If this method is invoked, it will either generate compiler warnings, or the @SuppressWarnings("rawtypes")
annotation will need to be applied (and, likely, the suppressing of"unchecked"
warnings will also have to be applied eventually) - Code:
- Exact Method Body:
return new RemoveUnsupportedIterator<>(allNonNullSummaryTables.iterator());
-
allNonNullSummaryTablesStream
public java.util.stream.Stream<SummaryTableHTML> allNonNullSummaryTablesStream ()
AnStream
of the Summary Tables defined on this page.- Returns:
- An Instance of
Stream<SummaryTableHTML>
.
NOTE: There is a raw-type used by theStream
that is returned. If this method is invoked, it will either generate compiler warnings, or the @SuppressWarnings("rawtypes")
annotation will need to be applied (and, likely, the suppressing of"unchecked"
warnings will also have to be applied eventually) - Code:
- Exact Method Body:
return allNonNullSummaryTables.stream();
-
allFieldDetails
public java.util.stream.Stream<ReflHTML<Field>> allFieldDetails()
This creates a stream of all of the Field's Details Sections on this Java Doc Web-Page. TheReflHTML<Field>
instances hold all of the HTML for the 'Field' that was placed on the page by Java Doc.
IMPORTANT: The use of retrieving these lists is that is that they may be used in conjunction with an an 'Extra-Tasks' Visitor/Handler to modify the HTML on a Java Doc Web-Page, in any way deemed necessary. Just register a handler with the Upgrade.extraTask configuration method. The method you write will be able to change, programmatically, the contents of Field "Details Sections" on the web-page.- Returns:
- A stream of all Field Details
- Code:
- Exact Method Body:
return allFieldDetails.stream();
-
allConstructorDetails
public java.util.stream.Stream<ReflHTML<Constructor>> allConstructorDetails ()
This creates a stream of all of the Constructor's Details Sections on this Java Doc Web-Page. TheReflHTML<Constructor>
instances hold all of the HTML for the 'Constructor' that was placed on the page by Java Doc.
IMPORTANT: The use of retrieving these lists is that is that they may be used in conjunction with an an 'Extra-Tasks' Visitor/Handler to modify the HTML on a Java Doc Web-Page, in any way deemed necessary. Just register a handler with the Upgrade.extraTask configuration method. The method you write will be able to change, programmatically, the contents of Constructor "Details Sections" on the web-page.- Returns:
- A stream of all Constructor Details
- Code:
- Exact Method Body:
return allConstructorDetails.stream();
-
allMethodDetails
public java.util.stream.Stream<ReflHTML<Method>> allMethodDetails()
This creates a stream of all of the Method's Details Sections on this Java Doc Web-Page. TheReflHTML<Method>
instances hold all of the HTML for the 'Method' that was placed on the page by Java Doc.
IMPORTANT: The use of retrieving these lists is that is that they may be used in conjunction with an an 'Extra-Tasks' Visitor/Handler to modify the HTML on a Java Doc Web-Page, in any way deemed necessary. Just register a handler with the Upgrade.extraTask configuration method. The method you write will be able to change, programmatically, the contents of Method "Details Sections" on the web-page.- Returns:
- A stream of all Method Details
- Code:
- Exact Method Body:
return allMethodDetails.stream();
-
allECDetails
public java.util.stream.Stream<ReflHTML<EnumConstant>> allECDetails()
This creates a stream of all of the Enumeration Constant's Details Sections on this Java Doc Web-Page. TheReflHTML<Enumeration Constant>
instances hold all of the HTML for the 'Enumeration Constant' that was placed on the page by Java Doc.
IMPORTANT: The use of retrieving these lists is that is that they may be used in conjunction with an an 'Extra-Tasks' Visitor/Handler to modify the HTML on a Java Doc Web-Page, in any way deemed necessary. Just register a handler with the Upgrade.extraTask configuration method. The method you write will be able to change, programmatically, the contents of Enumeration Constant "Details Sections" on the web-page.- Returns:
- A stream of all Enumeration-Constant Details
- Throws:
UpgradeException
- If invoked on a Java Doc Web-Page that isn't an'enum'
- Code:
- Exact Method Body:
if (this.ciet != CIET.ENUM) throw new UpgradeException( "This Java Doc Web-Page is for a(n) [" + ciet.toString() + "], but only Java " + "enum's may define Enum-Constants." ); return allECDetails.stream();
-
allAEDetails
public java.util.stream.Stream<ReflHTML<AnnotationElem>> allAEDetails()
This creates a stream of all of the Anotation Element's Details Sections on this Java Doc Web-Page. TheReflHTML<Anotation Element>
instances hold all of the HTML for the 'Anotation Element' that was placed on the page by Java Doc.
IMPORTANT: The use of retrieving these lists is that is that they may be used in conjunction with an an 'Extra-Tasks' Visitor/Handler to modify the HTML on a Java Doc Web-Page, in any way deemed necessary. Just register a handler with the Upgrade.extraTask configuration method. The method you write will be able to change, programmatically, the contents of Anotation Element "Details Sections" on the web-page.- Returns:
- A stream of all Annotation-Element Details
- Throws:
UpgradeException
- If invoked on a Java Doc Web-Page that isn't an Annotation- Code:
- Exact Method Body:
if (this.ciet != CIET.ANNOTATION) throw new UpgradeException( "This Java Doc Web-Page is for a(n) [" + ciet.toString() + "], but only Java " + "Annotations may define Annotation-Elements." ); return allAEDetails.stream();
-
fieldDetailsIterator
public java.util.Iterator<ReflHTML<Field>> fieldDetailsIterator()
This creates anIterator
that will iterate on the Detail's Section for Field's. The contents of theIterator
areSubSection
, which, themselves, contain the HTML describing the 'Field' - and the location where that HTML is on the main Java Doc web-page, as aDotPair
- Returns:
- An
Iterator<ReflHTML<Field>>
for each "Field Details" entry - See Also:
RemoveUnsupportedIterator
- Code:
- Exact Method Body:
return new RemoveUnsupportedIterator<>(allFieldDetails.iterator());
-
constructorDetailsIterator
public java.util.Iterator<ReflHTML<Constructor>> constructorDetailsIterator ()
This creates anIterator
that will iterate on the Detail's Section for Constructor's. The contents of theIterator
areSubSection
, which, themselves, contain the HTML describing the 'Constructor' - and the location where that HTML is on the main Java Doc web-page, as aDotPair
- Returns:
- An
Iterator<ReflHTML<Constructor>>
for each "Constructor Details" entry - See Also:
RemoveUnsupportedIterator
- Code:
- Exact Method Body:
return new RemoveUnsupportedIterator<>(allConstructorDetails.iterator());
-
methodDetailsIterator
public java.util.Iterator<ReflHTML<Method>> methodDetailsIterator()
This creates anIterator
that will iterate on the Detail's Section for Method's. The contents of theIterator
areSubSection
, which, themselves, contain the HTML describing the 'Method' - and the location where that HTML is on the main Java Doc web-page, as aDotPair
- Returns:
- An
Iterator<ReflHTML<Method>>
for each "Method Details" entry - See Also:
RemoveUnsupportedIterator
- Code:
- Exact Method Body:
return new RemoveUnsupportedIterator<>(allMethodDetails.iterator());
-
ecDetailsIterator
public java.util.Iterator<ReflHTML<EnumConstant>> ecDetailsIterator()
This creates anIterator
that will iterate on the Detail's Section for Enumeration Constant's. The contents of theIterator
areSubSection
, which, themselves, contain the HTML describing the 'Enumeration Constant' - and the location where that HTML is on the main Java Doc web-page, as aDotPair
- Returns:
- An
Iterator<ReflHTML<EnumConstant>>
for each "Enumeration Constant Details" entry - Throws:
UpgradeException
- If invoked on a Java Doc Web-Page that isn't an'enum'
- See Also:
RemoveUnsupportedIterator
- Code:
- Exact Method Body:
if (this.ciet != CIET.ENUM) throw new UpgradeException( "This Java Doc Web-Page is for a(n) [" + ciet.toString() + "], but only Java " + "enum's may define Enum-Constants." ); return new RemoveUnsupportedIterator<>(allECDetails.iterator());
-
aeDetailsIterator
public java.util.Iterator<ReflHTML<AnnotationElem>> aeDetailsIterator()
This creates anIterator
that will iterate on the Detail's Section for Annotation Element's. The contents of theIterator
areSubSection
, which, themselves, contain the HTML describing the 'Annotation Element' - and the location where that HTML is on the main Java Doc web-page, as aDotPair
- Returns:
- An
Iterator<ReflHTML<AnnotationElem>>
for each "Annotation Element Details" entry - Throws:
UpgradeException
- If invoked on a Java Doc Web-Page that isn't an Annotation.- See Also:
RemoveUnsupportedIterator
- Code:
- Exact Method Body:
if (this.ciet != CIET.ANNOTATION) throw new UpgradeException( "This Java Doc Web-Page is for a(n) [" + ciet.toString() + "], but only Java " + "Annotations may define Annotation-Elements." ); return new RemoveUnsupportedIterator<>(allAEDetails.iterator());
-
findMethodHTML
public java.util.stream.Stream<ReflHTML<Method>> findMethodHTML (java.util.function.Predicate<Method> finder)
Returns a list as ajava.util.stream.Stream
of all Reflected-HTML-Method
instances that match a user-specified finder-predicate- Parameters:
finder
- AnyPredicate<Method>
- Returns:
- A Java Stream containing all
Method
-ReflHTML
instances that were accepted by the finder'stest()
method. - See Also:
findMethodHTML(String)
- Code:
- Exact Method Body:
Stream.Builder<ReflHTML<Method>> b = Stream.builder(); for (ReflHTML<Method> m : allMethodDetails) if (finder.test(m.entity)) b.accept(m); return b.build();
-
findConstructorHTML
public java.util.stream.Stream<ReflHTML<Constructor>> findConstructorHTML (java.util.function.Predicate<Constructor> finder)
Returns a list as ajava.util.stream.Stream
of all Reflected-HTML-Constructor
instances that match a user-specified finder-predicate- Parameters:
finder
- AnyPredicate<Constructor>
- Returns:
- A Java Stream containing all
Constructor
-ReflHTML
instances that were accepted by the finder'stest()
method. - See Also:
findConstructorHTML(int)
- Code:
- Exact Method Body:
Stream.Builder<ReflHTML<Constructor>> b = Stream.builder(); for (ReflHTML<Constructor> c : allConstructorDetails) if (finder.test(c.entity)) b.accept(c); return b.build();
-
findFieldHTML
public java.util.stream.Stream<ReflHTML<Field>> findFieldHTML (java.util.function.Predicate<Field> finder)
Returns a list as ajava.util.stream.Stream
of all Reflected-HTML-Method
instances that match a user-specified finder-predicate- Parameters:
finder
- AnyPredicate<Field>
- Returns:
- A Java Stream containing all
Field
-ReflHTML
instances that were accepted by the finder'stest()
method - Code:
- Exact Method Body:
Stream.Builder<ReflHTML<Field>> b = Stream.builder(); for (ReflHTML<Field> f : allFieldDetails) if (finder.test(f.entity)) b.accept(f); return b.build();
-
findECHTML
public java.util.stream.Stream<ReflHTML<EnumConstant>> findECHTML (java.util.function.Predicate<EnumConstant> finder)
Returns a list as ajava.util.stream.Stream
of all Reflected-HTML-EnumConstant
instances that match a user-specified finder-predicate- Parameters:
finder
- AnyPredicate<EnumConstant>
- Returns:
- A Java Stream containing all
EnumConstant
-ReflHTML
instances that were accepted by the finder'stest()
method - Throws:
UpgradeException
- Only a JavaCIET
/Type'enum'
is allowed to declare Enum-Constants, and therefore this exception throws when this method is invoked on a Java Doc HTML File that doesn't represent anenum
.- Code:
- Exact Method Body:
if (this.ciet != CIET.ENUM) throw new UpgradeException( "Finding Enumeration-Constants is only possible with HTML Files for Java 'enum' " + "Type's. This file is of type [" + this.ciet.toString() + "]" ); Stream.Builder<ReflHTML<EnumConstant>> b = Stream.builder(); for (ReflHTML<EnumConstant> ec : allECDetails) if (finder.test(ec.entity)) b.accept(ec); return b.build();
-
findAEHTML
public java.util.stream.Stream<ReflHTML<AnnotationElem>> findAEHTML (java.util.function.Predicate<AnnotationElem> finder)
Returns a list as ajava.util.stream.Stream
of all Reflected-HTML-AnnotationElem
instances that match a user-specified finder-predicate- Parameters:
finder
- AnyPredicate<AnnotationElem>
- Returns:
- A Java Stream containing all
AnnotationElem
-ReflHTML
instances that were accepted by the finder'stest()
method - Throws:
UpgradeException
- Only a JavaCIET
/Type'@interface'
is allowed to declare Annotation-Elements, and therefore this exception throws when this method is invoked on a Java Doc HTML File that doesn't represent an annotation.- Code:
- Exact Method Body:
if (this.ciet != CIET.ENUM) throw new UpgradeException( "Finding Annotation-Elements is only possible with HTML Files for Java '@interface' " + "(Annotation) Type's. This file is of type [" + this.ciet.toString() + "]" ); Stream.Builder<ReflHTML<AnnotationElem>> b = Stream.builder(); for (ReflHTML<AnnotationElem> ae : allAEDetails) if (finder.test(ae.entity)) b.accept(ae); return b.build();
-
findMethodHTML
public java.util.stream.Stream<ReflHTML<Method>> findMethodHTML (java.lang.String methodName)
- Code:
- Exact Method Body:
return findMethodHTML((Method m) -> m.name.equals(methodName));
-
findMethodHTML
public java.util.stream.Stream<ReflHTML<Method>> findMethodHTML (int numParameters)
- Code:
- Exact Method Body:
return findMethodHTML((Method m) -> m.numParameters() == numParameters);
-
findConstructorHTML
public java.util.stream.Stream<ReflHTML<Constructor>> findConstructorHTML (int numParameters)
Convenience Method
Invokes:findConstructorHTML(Predicate)
Passes: Constructor-Parameter-CountPredicate
- Code:
- Exact Method Body:
return findConstructorHTML((Constructor c) -> c.numParameters() == numParameters);
-
findFieldHTML
public ReflHTML<Field> findFieldHTML(java.lang.String fieldName)
The Reflected-HTML Field having the specified name, or null if no such field exists- Parameters:
fieldName
- The name of the field being searched- Returns:
- The
ReflHTML<Field>
instance, from'this'
Java Doc Page, whose name matchesfieldName
, or null it wasn't found. - Code:
- Exact Method Body:
for (ReflHTML<Field> f : allFieldDetails) if (f.entity.name.equals(fieldName)) return f; return null;
-
findECHTML
public ReflHTML<EnumConstant> findECHTML (java.lang.String enumConstantName)
The Reflected-HTML Enum-Constant having the specified name, or null if no such constant exists- Parameters:
enumConstantName
- The name of the constant being searched- Returns:
- The
ReflHTML<EnumConstant>
instance, from'this'
Java Doc Page, whose name matchesenumConstantName
, or null it wasn't found. - Throws:
UpgradeException
- Only a JavaCIET
/Type'enum'
is allowed to declare Enum-Constants, and therefore this exception throws when this method is invoked on a Java Doc HTML File that doesn't represent anenum
.- Code:
- Exact Method Body:
if (this.ciet != CIET.ENUM) throw new UpgradeException( "Finding Enumeration-Constants is only possible with HTML Files for Java 'enum' " + "Type's. This file is of type [" + this.ciet.toString() + "]" ); for (ReflHTML<EnumConstant> ec : allECDetails) if (ec.entity.name.equals(enumConstantName)) return ec; return null;
-
findAEHTML
public ReflHTML<AnnotationElem> findAEHTML (java.lang.String annotationElemName)
The Reflected-HTML Annotation-Element having the specified name, or null if no such element exists- Parameters:
annotationElemName
- The name of the constant being searched- Returns:
- The
ReflHTML<EnumConstant>
instance, from'this'
Java Doc Page, whose name matchesannotationElemName
, or null it wasn't found. - Throws:
UpgradeException
- Only a JavaCIET
/Type'@interface'
is allowed to declare Annotation-Elements, and therefore this exception throws when this method is invoked on a Java Doc HTML File that doesn't represent an annotation.- Code:
- Exact Method Body:
if (this.ciet != CIET.ANNOTATION) throw new UpgradeException( "Finding Annotation-Elements is only possible with HTML Files for Java '@interface' " + "(Annotation) Type's. This file is of type [" + this.ciet.toString() + "]" ); for (ReflHTML<AnnotationElem> ae : allAEDetails) if (ae.entity.name.equals(annotationElemName)) return ae; return null;
-
findReflHTML
public <ENTITY extends Declaration> ReflHTML<ENTITY> findReflHTML (int declarationID, java.lang.Class<ENTITY> c)
Finds a matchingReflHTML
instance whose internal'entity'
field has an ID number that matches input-parameter'declarationID'
.- Parameters:
declarationID
- Whenever any instance of a sub-class ofDeclaration
is created, it is given a unique id that uniquely identifies it across the entire life-cycle of the JVM that is currently running.c
- This must be a Javajava.lang.Class
from one of the following:Constructor
,Method
,Field
,EnumConstant
orAnnotationElem
.
NOTE: This class is very easily obtained by simple using the'enum'
fieldEntity.upgraderReflectionClass
. To pass the appropriate class for a method, simply passEntity.METHOD.upgraderReflectionClass
to this parameter.
ALSO: Even more easy (if you know the member/entity type), you can hard-code / hand-type the class yourself - for instanceMethod.class
. If you were searching for aReflHTML<Field>
, you would passField.class
to this parameter.- Returns:
- The
ReflHTML
instance whose HTML describes the Method, Field, or Constructor etc... whose actual Reflected-class has an ID that matches'declarationID'
. Note that the second parameter'c'
is primarily used to "speed up" the search process.
Example:
// Note the 'Method' being passed is Torello.JavaDoc.Method (not java.lang.reflect.Method) ReflHTML<Method> refl = jdhf.findEntity(someEntityID, Method.class);
- Throws:
java.lang.IllegalArgumentException
- If the value passed to'declarationID'
is negative.- Code:
- Exact Method Body:
if (declarationID < 0) throw new IllegalArgumentException ("You have passed a negative declarationID: " + declarationID); if (Constructor.class.equals(c)) // This is **CLEARLY** not an unchecked cast! for (ReflHTML<Constructor> r : allConstructorDetails) { if (r.entity.id == declarationID) return (ReflHTML<ENTITY>) r; } else if (Method.class.equals(c)) for (ReflHTML<Method> r : allMethodDetails) { if (r.entity.id == declarationID) return (ReflHTML<ENTITY>) r; } else if (Field.class.equals(c)) for (ReflHTML<Field> r : allFieldDetails) { if (r.entity.id == declarationID) return (ReflHTML<ENTITY>) r; } else if (EnumConstant.class.equals(c)) for (ReflHTML<EnumConstant> r : allECDetails) { if (r.entity.id == declarationID) return (ReflHTML<ENTITY>) r; } else if (AnnotationElem.class.equals(c)) for (ReflHTML<AnnotationElem> r : allAEDetails) { if (r.entity.id == declarationID) return (ReflHTML<ENTITY>) r; } return null;
-
allIDsAndHREFs
public Ret2<java.util.TreeSet<java.lang.String>,java.util.TreeSet<java.lang.String>> allIDsAndHREFs ()
- Code:
- Exact Method Body:
TreeSet<String> allIDs = new TreeSet<>(); TreeSet<String> allHREFs = new TreeSet<>(); TagNode tn; for (HTMLNode n : updatedFileVec) if ((tn = n.openTagPWA()) != null) { String id = tn.AV("id"); String href = tn.AV("href"); if (id != null) allIDs.add(id); if (href != null) { if (href.equals("#top")) continue; if (StrCmpr.startsWithXOR( href, "http://", "https://", "/", "javascript:" )) continue; allHREFs.add(StrReplace.r(href, MATCH_STRS, REPLACE_STRS)); } } return new Ret2<>(allIDs, allHREFs);
-
-