Package Torello.JavaDoc
Class ParsedFile
- java.lang.Object
-
- Torello.JavaDoc.ParsedFile
-
- All Implemented Interfaces:
java.io.Serializable
- Direct Known Subclasses:
JavaDocHTMLFile
public abstract class ParsedFile extends java.lang.Object implements java.io.Serializable
Parent-class ofJavaDocHTMLFile
and the source-code parsing classes.
This class is abstract and there are two primary classes which extend it. This class is designed to hold all of the information - injava.lang.String
format - about a Java class, interface or enumerated type. This information generally includes lists of fields, methods and constructor declarations. This class acceptsString's
(in its constructor) from the two classes which extend it. ThoseString's
are found by the JavaParser Tool.
The easiest way to think about this is that this is a (tremendously) pared down version of the JavaParser Library, that holds the essential information need to HiLite & Update a JavaDoc Web-Page using thisUpgrade
Tool. The standard Java Reflection API, inside Java Packagejava.lang.reflect.*
is capable of supplying all of the method, constructor and field names (and parameters) for just about any Java Class. However, what the Reflect API cannot supply are Method Bodies & Constructor Bodies as instances ofjava.lang.String
. These are required so that they may be syntax hilited by the hiliter, and that's what makes the Java Parser Library JAR necessary.
This class serves as the root-class for both parsed Java-Doc HTML Pages, and parsed Java Source-Code'.java'
pages.- See Also:
- Serialized Form
Hi-Lited Source-Code:- View Here: Torello/JavaDoc/ParsedFile.java
- Open New Browser-Tab: Torello/JavaDoc/ParsedFile.java
File Size: 46,126 Bytes Line Count: 1,087 '\n' Characters Found
-
-
Field Summary
Serializable ID Modifier and Type Field static long
serialVersionUID
CIET Name & Package Name Modifier and Type Field String
fullyQualifiedName
String
javaSrcFileAsStr
String
name
String
packageName
String
simpleName
Basic Source-File Data Modifier and Type Field CIET
ciet
protected String[]
containerClasses
String
fileName
protected ReadOnlyList<String>
genericParameters
Boolean Flags Modifier and Type Field boolean
isGeneric
boolean
isInner
Source-File Reflected-Entites / Reflected-Members Lists Modifier and Type Field protected Vector<AnnotationElem>
annotationElems
protected Vector<Constructor>
constructors
protected Vector<EnumConstant>
enumConstants
protected Vector<Field>
fields
protected Vector<Method>
methods
protected Vector<NestedType>
nestedTypes
Source-Code Line-Number Information Modifier and Type Field int
endLineNumber
int
jdEndLineNumber
int
jdStartLineNumber
int
startLineNumber
Source-Code Size Modifier and Type Field int
typeLineCount
int
typeSizeChars
Protected, Internally Used Modifier and Type Field protected Torello.JDUInternal.DATA_RECORDS.MainLoopData.AnnotationsMirror
annotationsMirror
-
Constructor Summary
Constructors Modifier Constructor protected
ParsedFile(String fileName, String name, String packageName, CIET ciet, ReadOnlyList<String> genericParameters, String fullyQualifiedName, int startLineNumber, int endLineNumber, int jdStartLineNumber, int jdEndLineNumber, int typeLineCount, int typeSizeChars, String javaSrcFileAsStr)
-
Method Summary
Methods for: Method's
Modifier and Type Method Method
findMethod(Torello.JDUInternal.DATA_RECORDS.MainLoopData.CallableSignature cSig)
Stream<Method>
findMethods(String methodName)
Method
getMethod(int i)
Method[]
getMethods()
void
getMethods(Consumer<Method> acceptMethodConsumer)
int
numMethods()
Methods for: Field's
Modifier and Type Method Field
findField(String name)
Field
getField(int i)
Field[]
getFields()
void
getFields(Consumer<Field> acceptFieldConsumer)
int
numFields()
Methods for: Constructor's
Modifier and Type Method Constructor
findConstructor(Torello.JDUInternal.DATA_RECORDS.MainLoopData.CallableSignature cSig)
Stream<Constructor>
findConstructors(int numParameters)
Constructor
getConstructor(int i)
Constructor[]
getConstructors()
void
getConstructors(Consumer<Constructor> acceptConstructorConsumer)
int
numConstructors()
Methods for: AnnotationElem's
Modifier and Type Method AnnotationElem
findAnnotationElem(String name)
AnnotationElem
getAnnotationElem(int i)
AnnotationElem[]
getAnnotationElems()
void
getAnnotationElems(Consumer<AnnotationElem> acceptAEConsumer)
int
numAnnotationElems()
Methods for: EnumConstant's
Modifier and Type Method EnumConstant
findEnumConstant(String name)
EnumConstant
getEnumConstant(int i)
EnumConstant[]
getEnumConstants()
void
getEnumConstants(Consumer<EnumConstant> acceptECConsumer)
int
numEnumConstants()
Methods for: NestedType's
Modifier and Type Method NestedType
findNestedType(String name)
NestedType
getNestedType(int i)
Method[]
getNestedTypes()
void
getNestedTypes(Consumer<NestedType> acceptNTConsumer)
int
numNestedTypes()
More Methods Modifier and Type Method String[]
getContainerClasses()
String[]
getGenericParameters()
toString() Methods Modifier and Type Method String
abbreviatedSummary(int lineWidth)
String
quickSummary()
String
toString()
String
toString(int flags)
Protected, Internal Methods Modifier and Type Method protected void
addAnnotationElem(AnnotationElem ae)
protected void
addConstructor(Constructor c)
protected void
addEnumConstant(EnumConstant ec)
protected void
addField(Field f)
protected void
addMethod(Method m)
protected void
addNestedType(NestedType nt)
-
-
-
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;
-
annotationsMirror
protected Torello.JDUInternal.DATA_RECORDS.MainLoopData.AnnotationsMirror annotationsMirror
Stores information provided by the JavaDoc Upgrader Annotations. Note, this Annotation Mirror does not contain information about any / all annotations used inside of Java Source Code Files, but rather only the ones created by this API.
These include@StaticFunctional
and also@JDHeaderBackgroundImg
-
javaSrcFileAsStr
public final java.lang.String javaSrcFileAsStr
This field simply contains the entire contents of the'.java'
Source-Code File from whence thisParsedFile
instance originated.
Note that for in for the sub-classJavaDocHTMLFile
, when the HTML file which was parsed represents an inner-class / nested-type, this field will still contain the entire contents of the top-level enclosing java type (as aString
) in this field.
For instance, if aJavaDocHTMLFile
(which inherits this class,ParsedFile
) instance had been generated for the Java-HTML inner-classTorello.HTML.Attributes.Filter
, which happens to be a nested type of classTorello.HTML.Attributes
, this field would contain the text-characters of the Source-FileTorello/HTML/Attributes.java
inString
-format (as character data).
-
fileName
public final java.lang.String fileName
Contains the file-name from which this instance was derived
-
name
public final java.lang.String name
Holds the name. A'ParsedFile'
represents a class, interface, or enumerated-type. This name is NOT the fully-qualified (package-included) name, and it will have any Generic Type Parameters appended, if this CIET represents a generic that has type-parameters.
If thisCIET
is an inner-class, the containingCIET
name is included in thisString
field.
For Instance:Input CIET
'name'
Field Valueinterface java.lang.Integer
"Integer"
class java.util.Vector<E>
"Vector<E>"
class java.util.Base64.Decoder
"Base.Decoder"
interface java.util.Map.Entry<K, V>
"Map.Entry<K, V>"
- See Also:
simpleName
,fullyQualifiedName
- Code:
- Exact Field Declaration Expression:
public final String name;
-
fullyQualifiedName
public final java.lang.String fullyQualifiedName
This holds the fully qualifiedCIET
name - which means that package and containing class information is included. If thiCIET
is a Java Generic that happens to have Generic Type Parameters (the'E'
inVector<E>
, this name WILL NOT include that text.
For Instance:Input CIET
'fullyQualifiedName'
Field Valueinterface java.lang.Integer
"java.lang.Integer"
class java.util.Vector<E>
"java.util.Vector"
class java.util.Base64.Decoder
"java.util.Base64.Decoder"
interface java.util.Map.Entry<K, V>
"java.util.Map.Entry"
- See Also:
simpleName
,name
- Code:
- Exact Field Declaration Expression:
public final String fullyQualifiedName;
-
simpleName
public final java.lang.String simpleName
This the same as thename
parameter, but leaves off both the type-parameters, and the fully-qualified package-nameString's
. If thisCIET
is an inner class the containingCIET
name is included in thisString
field. See the table below, for details:Input CIET
'simpleName'
Field Valueinterface java.lang.Integer
"Integer"
class java.util.Vector<E>
"Vector"
class java.util.Base64.Decoder
"Base64.Decoder"
interface java.util.Map.Entry<K, V>
"Map.Entry"
- See Also:
name
,fullyQualifiedName
- Code:
- Exact Field Declaration Expression:
public final String simpleName;
-
packageName
public final java.lang.String packageName
Holds the package-name. If thisParsedFile
were for classjava.lang.String
the'packageName'
would be'java.lang'
.
-
ciet
-
isInner
public final boolean isInner
This identifies inner classes and interfaces.'isInner'
Field ValueInput CIET
false
interface java.lang.Integer
false
class java.util.Vector<E>
true
class java.util.Base64.Decoder
true
interface java.util.Map.Entry<K, V>
-
containerClasses
protected final java.lang.String[] containerClasses
This identifies inner classes and interfaces. For any class that is not an inner class, this will be a zero-lengthString[]
array.'containerClasses'
ValueInput CIET
{ }
interface java.lang.Integer
{ }
class java.util.Vector<E>
{ "Base64" }
class java.util.Base64.Decoder
{ "Map" }
interface java.util.Map.Entry<K, V>
- See Also:
getContainerClasses()
- Code:
- Exact Field Declaration Expression:
protected final String[] containerClasses;
-
isGeneric
public final boolean isGeneric
This field will beTRUE
anytime thegenericParameters
field has any elements.
-
genericParameters
protected final ReadOnlyList<java.lang.String> genericParameters
If this represents a Java Generic Class or Interface, with generic type information, the generic type parameters shall be saved here.- See Also:
getGenericParameters()
- Code:
- Exact Field Declaration Expression:
protected final ReadOnlyList<String> genericParameters;
-
startLineNumber
public final int startLineNumber
The line-number in the source-code file where this class definition actually begins.
Note that if this instance ofParsedFile
is representing a Nessted-Type / Inner-Class, then this field will contain the line-number where that inner-type's definition begins inside the Enclosing-Class''.java'
file.
-
endLineNumber
public final int endLineNumber
The line-number in the source-code file where this class definition ends. Often this will just be the line-number of the last line in the'.java'
file.
If this is a Nested-Type, this field will contain the line-number where the definition of the Nested-type ends.
-
jdStartLineNumber
public final int jdStartLineNumber
The starting line-number of the JavaDoc Comment at the top of the class. If this class does not have a Java-Doc Comment, this field will contain-1
.
-
jdEndLineNumber
public final int jdEndLineNumber
The endiing line-number of the JavaDoc Comment at the top of the class. If this class does not have a Java-Doc Comment, this field will contain-1
.
-
typeLineCount
public final int typeLineCount
The number of lines of Source-Code inside this'.java'
File. If this instance ofParsedFile
represents an Inner-Type (Nested-Class), then this field will contain a value that corresponds only to the number of lines used by the Nested-Type within the context of the entire Enclosing-Class'.java'
file.
-
typeSizeChars
public final int typeSizeChars
The number of characters / bytes of Source-Code inside this'.java'
File. If this instance ofParsedFile
represents an Inner-Type (Nested-Class), then this field will contain a value that corresponds only to the number of characters / bytes used by the Nested-Type within the context of the entire Enclosing-Class'.java'
file.
-
methods
-
constructors
protected final java.util.Vector<Constructor> constructors
This is the list ofConstructor
instances identified by the parser for thisParsedFile
-
fields
-
annotationElems
protected final java.util.Vector<AnnotationElem> annotationElems
This is the list ofAnnotationElem
instances identified by the parser for thisParsedFile
IMPORTANT: The vast majority of source-files will not contain anyAnnotationElem's
. Unless the source-file used to build'this'
was anannotation
it would simply not be possible to define an AnnotationElem for theannotation
-
enumConstants
protected final java.util.Vector<EnumConstant> enumConstants
This is the list ofEnumConstant
instances identified by the parser for thisParsedFile
IMPORTANT: The vast majority of source-files will not contain anyEnumConstant's
. Unless the source-file used to build'this'
was anenum
it would simply not be possible to define an EnumConstant for theenum
- See Also:
enumConstants
- Code:
- Exact Field Declaration Expression:
protected final Vector<EnumConstant> enumConstants = new Vector<>();
-
nestedTypes
protected final java.util.Vector<NestedType> nestedTypes
This is the list ofNestedType
instances identified by the parser for thisParsedFile
-
-
Constructor Detail
-
ParsedFile
protected ParsedFile(java.lang.String fileName, java.lang.String name, java.lang.String packageName, CIET ciet, ReadOnlyList<java.lang.String> genericParameters, java.lang.String fullyQualifiedName, int startLineNumber, int endLineNumber, int jdStartLineNumber, int jdEndLineNumber, int typeLineCount, int typeSizeChars, java.lang.String javaSrcFileAsStr)
Subclasses of'ParsedFile'
should use this constructor to initialize these fields.
Used by bothJavaDocHTMLFile
andJavaSourceCodeFile
-
-
Method Detail
-
getContainerClasses
public java.lang.String[] getContainerClasses()
Returns the container classes (if any) for this class, interface, etc.- Returns:
- The list of container classes, from outer to inner, for this class. If
this is a normal class that is not an inner class, this will return an empty
(zero-lengh)
String[]
array. - See Also:
containerClasses
- Code:
- Exact Method Body:
return (containerClasses.length > 0) ? containerClasses.clone() : StringParse.EMPTY_STR_ARRAY;
-
getGenericParameters
public java.lang.String[] getGenericParameters()
Returns the generic type parameters (if any) for this class or interface- Returns:
- The generic type parameters as a
String[]
array. If this class is not a Java Generic, a zero-lengthString[]
array will be returned. - See Also:
genericParameters
- Code:
- Exact Method Body:
return genericParameters.toArray(new String[genericParameters.size()]);
-
addMethod
-
numMethods
public int numMethods()
-
getMethod
-
getMethods
public Method[] getMethods()
-
getMethods
public void getMethods (java.util.function.Consumer<Method> acceptMethodConsumer)
-
addConstructor
protected final void addConstructor(Constructor c)
Inserts anotherConstructor
into the internalconstructors
Vector
. Both of the inheriting subclasses of this class use this method to build a list ofconstructors
for EITHER a particular'.java'
source-file OR a'.html'
Java Doc Web-Page.- Parameters:
c
-Constructor
to insert into the list ofconstructors
. Internally, the order in which theseConstructor's
are inserted is preserved. The internal data-structure used isVector<Constructor>
- See Also:
constructors
- Code:
- Exact Method Body:
constructors.add(c);
-
numConstructors
public int numConstructors()
Returns the number ofConstructor's
that were successfully parsed by whichever parser was used.- Returns:
- The number of
Constructor's
in this class' internally storedconstructors
Vector
. - See Also:
constructors
- Code:
- Exact Method Body:
return constructors.size();
-
getConstructor
public Constructor getConstructor(int i)
This will retrieve the ithConstructor
that was defined in the original source-code ('.java'
) or documentation ('.html'
) file.- Parameters:
i
- Index into theconstructors
Vector
- Returns:
- The ith element of the
constructors
Vector
, as an instance ofConstructor
- See Also:
constructors
- Code:
- Exact Method Body:
return constructors.elementAt(i);
-
getConstructors
public Constructor[] getConstructors()
Retrieves the complete list ofConstructor's
that were defined in the original source-code ('.java'
) or documentation ('.html'
) file.- Returns:
- A copy of the contents of the internal
constructors
Vector
, as an array - See Also:
constructors
- Code:
- Exact Method Body:
return constructors.toArray(new Constructor[constructors.size()]);
-
getConstructors
public void getConstructors (java.util.function.Consumer<Constructor> acceptConstructorConsumer)
Iterates the contents of theconstructors
Vector
, and sends eachConstructor
to a user-providedjava.util.function.Consumer<Constructor>
- Parameters:
acceptConstructorConsumer
- Any user-providedConsumer
- See Also:
constructors
- Code:
- Exact Method Body:
constructors.forEach ((Constructor constructor) -> acceptConstructorConsumer.accept(constructor));
-
addField
-
numFields
-
getField
-
addAnnotationElem
protected final void addAnnotationElem(AnnotationElem ae)
Inserts anotherAnnotationElem
into the internalannotationElems
Vector
. Both of the inheriting subclasses of this class use this method to build a list ofannotationElems
for EITHER a particular'.java'
source-file OR a'.html'
Java Doc Web-Page.- Parameters:
ae
-AnnotationElem
to insert into the list ofannotationElems
. Internally, the order in which theseAnnotationElem's
are inserted is preserved. The internal data-structure used isVector<AnnotationElem>
- See Also:
annotationElems
- Code:
- Exact Method Body:
annotationElems.add(ae);
-
numAnnotationElems
public int numAnnotationElems()
Returns the number ofAnnotationElem's
that were successfully parsed by whichever parser was used.
IMPORTANT: The vast majority of source-files will not contain anyAnnotationElem's
. Unless the source-file used to build'this'
was anannotation
it would simply not be possible to define an AnnotationElem for theannotation
- Returns:
- The number of
AnnotationElem's
in this class' internally storedannotationElems
Vector
. - See Also:
annotationElems
- Code:
- Exact Method Body:
return annotationElems.size();
-
getAnnotationElem
public AnnotationElem getAnnotationElem(int i)
This will retrieve the ithAnnotationElem
that was defined in the original source-code ('.java'
) or documentation ('.html'
) file.
IMPORTANT: The vast majority of source-files will not contain anyAnnotationElem's
. Unless the source-file used to build'this'
was anannotation
it would simply not be possible to define an AnnotationElem for theannotation
- Parameters:
i
- Index into theannotationElems
Vector
- Returns:
- The ith element of the
annotationElems
Vector
, as an instance ofAnnotationElem
- See Also:
annotationElems
- Code:
- Exact Method Body:
return annotationElems.elementAt(i);
-
getAnnotationElems
public AnnotationElem[] getAnnotationElems()
Retrieves the complete list ofAnnotationElem's
that were defined in the original source-code ('.java'
) or documentation ('.html'
) file.
IMPORTANT: The vast majority of source-files will not contain anyAnnotationElem's
. Unless the source-file used to build'this'
was anannotation
it would simply not be possible to define an AnnotationElem for theannotation
- Returns:
- A copy of the contents of the internal
annotationElems
Vector
, as an array - See Also:
annotationElems
- Code:
- Exact Method Body:
return annotationElems.toArray(new AnnotationElem[annotationElems.size()]);
-
getAnnotationElems
public void getAnnotationElems (java.util.function.Consumer<AnnotationElem> acceptAEConsumer)
Iterates the contents of theannotationElems
Vector
, and sends eachAnnotationElem
to a user-providedjava.util.function.Consumer<AnnotationElem>
IMPORTANT: The vast majority of source-files will not contain anyAnnotationElem's
. Unless the source-file used to build'this'
was anannotation
it would simply not be possible to define an AnnotationElem for theannotation
- Parameters:
acceptAEConsumer
- Any user-providedConsumer
- See Also:
annotationElems
- Code:
- Exact Method Body:
annotationElems.forEach((AnnotationElem elem) -> acceptAEConsumer.accept(elem));
-
addEnumConstant
protected final void addEnumConstant(EnumConstant ec)
Inserts anotherEnumConstant
into the internalenumConstants
Vector
. Both of the inheriting subclasses of this class use this method to build a list ofenumConstants
for EITHER a particular'.java'
source-file OR a'.html'
Java Doc Web-Page.
IMPORTANT: The vast majority of source-files will not contain anyEnumConstant's
. Unless the source-file used to build'this'
was anenum
it would simply not be possible to define an EnumConstant for theenum
- Parameters:
ec
-EnumConstant
to insert into the list ofenumConstants
. Internally, the order in which theseEnumConstant's
are inserted is preserved. The internal data-structure used isVector<EnumConstant>
- See Also:
enumConstants
- Code:
- Exact Method Body:
enumConstants.add(ec);
-
numEnumConstants
public int numEnumConstants()
Returns the number ofEnumConstant's
that were successfully parsed by whichever parser was used.
IMPORTANT: The vast majority of source-files will not contain anyEnumConstant's
. Unless the source-file used to build'this'
was anenum
it would simply not be possible to define an EnumConstant for theenum
- Returns:
- The number of
EnumConstant's
in this class' internally storedenumConstants
Vector
. - See Also:
enumConstants
- Code:
- Exact Method Body:
return enumConstants.size();
-
getEnumConstant
public EnumConstant getEnumConstant(int i)
This will retrieve the ithEnumConstant
that was defined in the original source-code ('.java'
) or documentation ('.html'
) file.
IMPORTANT: The vast majority of source-files will not contain anyEnumConstant's
. Unless the source-file used to build'this'
was anenum
it would simply not be possible to define an EnumConstant for theenum
- Parameters:
i
- Index into theenumConstants
Vector
- Returns:
- The ith element of the
enumConstants
Vector
, as an instance ofEnumConstant
- See Also:
enumConstants
- Code:
- Exact Method Body:
return enumConstants.elementAt(i);
-
getEnumConstants
public EnumConstant[] getEnumConstants()
Retrieves the complete list ofEnumConstant's
that were defined in the original source-code ('.java'
) or documentation ('.html'
) file.
IMPORTANT: The vast majority of source-files will not contain anyEnumConstant's
. Unless the source-file used to build'this'
was anenum
it would simply not be possible to define an EnumConstant for theenum
- Returns:
- A copy of the contents of the internal
enumConstants
Vector
, as an array - See Also:
enumConstants
- Code:
- Exact Method Body:
return enumConstants.toArray(new EnumConstant[enumConstants.size()]);
-
getEnumConstants
public void getEnumConstants (java.util.function.Consumer<EnumConstant> acceptECConsumer)
Iterates the contents of theenumConstants
Vector
, and sends eachEnumConstant
to a user-providedjava.util.function.Consumer<EnumConstant>
IMPORTANT: The vast majority of source-files will not contain anyEnumConstant's
. Unless the source-file used to build'this'
was anenum
it would simply not be possible to define an EnumConstant for theenum
- Parameters:
acceptECConsumer
- Any user-providedConsumer
- See Also:
enumConstants
- Code:
- Exact Method Body:
enumConstants.forEach((EnumConstant elem) -> acceptECConsumer.accept(elem));
-
addNestedType
protected final void addNestedType(NestedType nt)
Inserts anotherNestedType
into the internalnestedTypes
Vector
. Both of the inheriting subclasses of this class use this method to build a list ofnestedTypes
for EITHER a particular'.java'
source-file OR a'.html'
Java Doc Web-Page.- Parameters:
nt
-NestedType
to insert into the list ofnestedTypes
. Internally, the order in which theseNestedType's
are inserted is preserved. The internal data-structure used isVector<NestedType>
- See Also:
nestedTypes
- Code:
- Exact Method Body:
nestedTypes.add(nt);
-
numNestedTypes
public int numNestedTypes()
Returns the number ofNestedType's
that were successfully parsed by whichever parser was used.- Returns:
- The number of
NestedType's
in this class' internally storednestedTypes
Vector
. - See Also:
nestedTypes
- Code:
- Exact Method Body:
return nestedTypes.size();
-
getNestedType
public NestedType getNestedType(int i)
This will retrieve the ithNestedType
that was defined in the original source-code ('.java'
) or documentation ('.html'
) file.- Parameters:
i
- Index into thenestedTypes
Vector
- Returns:
- The ith element of the
nestedTypes
Vector
, as an instance ofNestedType
- See Also:
nestedTypes
- Code:
- Exact Method Body:
return nestedTypes.elementAt(i);
-
getNestedTypes
public Method[] getNestedTypes()
Retrieves the complete list ofNestedType's
that were defined in the original source-code ('.java'
) or documentation ('.html'
) file.- Returns:
- A copy of the contents of the internal
nestedTypes
Vector
, as an array - See Also:
nestedTypes
- Code:
- Exact Method Body:
return methods.toArray(new Method[methods.size()]);
-
getNestedTypes
public void getNestedTypes (java.util.function.Consumer<NestedType> acceptNTConsumer)
Iterates the contents of thenestedTypes
Vector
, and sends eachNestedType
to a user-providedjava.util.function.Consumer<NestedType>
- Parameters:
acceptNTConsumer
- Any user-providedConsumer
- See Also:
nestedTypes
- Code:
- Exact Method Body:
nestedTypes.forEach((NestedType type) -> acceptNTConsumer.accept(type));
-
findMethod
public Method findMethod (Torello.JDUInternal.DATA_RECORDS.MainLoopData.CallableSignature cSig)
Finds a Method having the characteristics specified by parameter'cSig'
.- Parameters:
cSig
- An internally generated representation of a Java-Method extrapolated from the information available on a Java-Doc HTML Detail Section- Returns:
- A method that matches the requested Method-Signature
- Code:
- Exact Method Body:
for (Method method : methods) if ( method.name.equals(cSig.name) && method.returnTypeJOW.equals(cSig.returnTypeJOW) && method.nearlyEqualsCallableSig(cSig) ) return method; return null;
-
findConstructor
public Constructor findConstructor (Torello.JDUInternal.DATA_RECORDS.MainLoopData.CallableSignature cSig)
Finds a Constructor having the characteristics specified by parameter'cSig'
.- Parameters:
cSig
- An internally generated representation of a Java-Constructor extrapolated from the information available on a Java-Doc HTML Detail Section- Returns:
- A Constructor that matches the requested Constructor-Signature
- Code:
- Exact Method Body:
for (Constructor ctor : constructors) if (ctor.nearlyEqualsCallableSig(cSig)) return ctor; return null;
-
findMethods
public java.util.stream.Stream<Method> findMethods (java.lang.String methodName)
Returns all internally-storedMethod
instances whoseMethod#name
field matches'name'
- Parameters:
methodName
- The name of theMethod
- Returns:
- An instance of
Stream<Method>
of allMethod's
named'name'
- See Also:
methods
,Declaration.name
- Code:
- Exact Method Body:
Stream.Builder<Method> b = Stream.builder(); for (Method method : methods) if (method.name.equals(methodName)) b.accept(method); return b.build();
-
findConstructors
public java.util.stream.Stream<Constructor> findConstructors (int numParameters)
Returns all internally-storedConstructor
instances for instances whose accepted parameters-list has a length equal tonumParameters
.- Parameters:
numParameters
- The number of parameters accepted by theConstructor
being searched.- Returns:
- An instance of
Stream<Constructor>
containing allConstructor's
whose number of parameterss equals'numParameters'
- See Also:
constructors
,Callable.numParameters()
- Code:
- Exact Method Body:
Stream.Builder<Constructor> b = Stream.builder(); for (Constructor constructor : constructors) if (constructor.numParameters() == numParameters) b.accept(constructor); return b.build();
-
findField
public Field findField(java.lang.String name)
Returns the internally-storedField
instance whose name matches parameter'name'
- Parameters:
name
- The name of theField
- Returns:
- The
Field
whosename
matches parameter'name'
. If there is no suchField
with that name defined in this parsed-file, then null is returned. - See Also:
Declaration.name
,fields
- Code:
- Exact Method Body:
for (Field field : fields) if (field.name.equals(name)) return field; return null;
-
findAnnotationElem
public AnnotationElem findAnnotationElem(java.lang.String name)
Returns the internally-storedAnnotationElem
instance whose name matches parameter'name'
IMPORTANT: The vast majority of source-files will not contain anyAnnotationElem's
. Unless the source-file used to build'this'
was anannotation
it would simply not be possible to define an AnnotationElem for theannotation
- Parameters:
name
- The name of theAnnotationElem
- Returns:
- The
AnnotationElem
whosename
matches parameter'name'
. If there is no suchAnnotationElem
with that name defined in this parsed-file, then null is returned. - See Also:
Declaration.name
,annotationElems
- Code:
- Exact Method Body:
for (AnnotationElem ae : annotationElems) if (ae.name.equals(name)) return ae; return null;
-
findEnumConstant
public EnumConstant findEnumConstant(java.lang.String name)
Returns the internally-storedEnumConstant
instance whose name matches parameter'name'
IMPORTANT: The vast majority of source-files will not contain anyEnumConstant's
. Unless the source-file used to build'this'
was anenum
it would simply not be possible to define an EnumConstant for theenum
- Parameters:
name
- The name of theEnumConstant
- Returns:
- The
EnumConstant
whosename
matches parameter'name'
. If there is no suchEnumConstant
with that name defined in this parsed-file, then null is returned. - See Also:
Declaration.name
,enumConstants
- Code:
- Exact Method Body:
for (EnumConstant ec : enumConstants) if (ec.name.equals(name)) return ec; return null;
-
findNestedType
public NestedType findNestedType(java.lang.String name)
Returns the internally-storedNestedType
instance whose name matches parameter'name'
- Parameters:
name
- The name of theNestedType
- Returns:
- The
NestedType
whosename
matches parameter'name'
. If there is no suchNestedType
with that name defined in this parsed-file, then null is returned. - See Also:
Declaration.name
,nestedTypes
- Code:
- Exact Method Body:
for (NestedType nt : nestedTypes) if (nt.name.equals(name)) return nt; return null;
-
toString
public java.lang.String toString()
Turns aParsedFile
result object,'this'
, into aString
. Passes'0'
to the standard flags-print method.- Overrides:
toString
in classjava.lang.Object
- Code:
- Exact Method Body:
return toString(0);
-
toString
public java.lang.String toString(int flags)
Turns aParsedFile
result object,'this'
, into ajava.lang.String
.
This will check for the'UNIX_COLORS'
flag inclass PF
. If this flag is identified, then a few unix color codes are added to the output.
IMPORTANT NOTE: The value of this flag will be propagated to the individualtoString(int flag)
methods in each of theMethod, Field, Constructor
etc... -toString(flag)
methods.- Returns:
- This returns a
String
that obeys the flag-requests by parameter flag. - See Also:
Method.toString(int)
,Constructor.toString(int)
,Field.toString(int)
- Code:
- Exact Method Body:
StringBuilder sb = new StringBuilder(); boolean c = (flags & PF.UNIX_COLORS) > 0; StringBuilder typeParamsSB = new StringBuilder(); for (String p : genericParameters) typeParamsSB.append(p + ", "); String typeParamsStr = (typeParamsSB.length() > 0) ? typeParamsSB.subSequence(0, typeParamsSB.length() - 1).toString() : "-"; StringBuilder containerClassesSB = new StringBuilder(); for (String p : containerClasses) containerClassesSB.append(p + ", "); String containerClassesStr = (containerClassesSB.length() > 0) ? containerClassesSB.subSequence(0, containerClassesSB.length() - 1).toString() : "-"; sb.append( "******************************************************************\n" + "Fields in this 'ParsedFile' instance:\n" + "******************************************************************\n" + "fileName: " + fileName + '\n' + "name: " + name + '\n' + "CIET: " + ciet + '\n' + "packageName: " + packageName + '\n' + "simpleName: " + simpleName + '\n' + "fullyQualifedName: " + fullyQualifiedName + '\n' + "isGeneric: " + isGeneric + '\n' + "Type Parameters: " + typeParamsStr + '\n' + "isInner: " + isInner + '\n' + "Container Classes: " + containerClassesStr + "\n\n" ); if (methods.size() > 0) { sb.append( "******************************************************************\n" + (c ? BRED : "") + "Methods:\n" + (c ? RESET : "") + "******************************************************************\n" ); for (Method m : methods) sb.append(m.toString(flags) + "\n\n"); } if (constructors.size() > 0) { sb.append( "******************************************************************\n" + (c ? BRED : "") + "Constructors:\n" + (c ? RESET : "") + "******************************************************************\n" ); for (Constructor cs : constructors) sb.append(cs.toString(flags) + "\n\n"); } if (fields.size() > 0) { sb.append( "******************************************************************\n" + (c ? BRED : "") + "Fields:\n" + (c ? RESET : "") + "******************************************************************\n" ); for (Field f : fields) sb.append(f.toString(flags) + "\n\n"); } if (annotationElems.size() > 0) { sb.append( "******************************************************************\n" + (c ? BRED : "") + "Annotation-Elements:\n" + (c ? RESET : "") + "******************************************************************\n" ); for (AnnotationElem ae : annotationElems) sb.append(ae.toString(flags) + "\n\n"); } if (enumConstants.size() > 0) { sb.append( "******************************************************************\n" + (c ? BRED : "") + "Enumerated Constants:\n" + (c ? RESET : "") + "******************************************************************\n" ); for (EnumConstant ec : enumConstants) sb.append(ec.toString(flags) + "\n\n"); } if (nestedTypes.size() > 0) { sb.append( "******************************************************************\n" + (c ? BRED : "") + "Nested Types:\n" + (c ? RESET : "") + "******************************************************************\n" ); for (NestedType nt : nestedTypes) sb.append(nt.toString(flags) + "\n\n"); } return sb.toString();
-
quickSummary
public java.lang.String quickSummary()
Provides a Quick Summary for this file.- Returns:
- The summary as a
java.lang.String
. Nothing is actually printed by this method. - Code:
- Exact Method Body:
String typeParams = (genericParameters.size() == 0) ? "" : ("Generic Type-Parameters: " + StrCSV.toCSV(getGenericParameters(), true, true, null) + '\n'); String ae = (annotationElems.size() == 0) ? "" : (", [" + BBLUE + StringParse.zeroPad(annotationElems.size()) + RESET + "] Annotation-Elements"); String ec = (enumConstants.size() == 0) ? "" : (", [" + BBLUE + StringParse.zeroPad(enumConstants.size()) + RESET + "] Enum-Constants"); String nt = (nestedTypes.size() == 0) ? "" : (", [" + BBLUE + StringParse.zeroPad(nestedTypes.size()) + RESET + "] Nested-Types"); return "Name [" + BYELLOW + name + RESET + "], " + "Package [" + BYELLOW + packageName + RESET + "], " + "CIET [" + BYELLOW + ciet + RESET + "]\n" + "Qualified [" + BYELLOW + fullyQualifiedName + RESET + "], " + "Simple [" + BYELLOW + simpleName + RESET + "]\n" + typeParams + '[' + BBLUE + StringParse.zeroPad(fields.size()) + RESET + "] Fields, " + '[' + BBLUE + StringParse.zeroPad(constructors.size()) + RESET + "] Constructors, " + '[' + BBLUE + StringParse.zeroPad(methods.size()) + RESET + "] Methods" + ae + ec + nt + '\n';
-
abbreviatedSummary
public java.lang.String abbreviatedSummary(int lineWidth)
Provides a Vertical-List Abbreviated Summary for this file.- Parameters:
lineWidth
- The number of characters wide the member-summary lines should be.- Returns:
- The summary as a
java.lang.String
. Nothing is actually printed by this method. - Code:
- Exact Method Body:
String typeParams = (genericParameters.size() == 0) ? "" : ("Generic Type-Parameters: " + StrCSV.toCSV(getGenericParameters(), true, true, null) + '\n'); String m = (methods.size() == 0) ? "Methods: *NONE*\n" : ("Methods:" + StrPrint.printListAbbrev (methods, lineWidth, 4, false, true, true) + '\n'); String f = (fields.size() == 0) ? "Fields: *NONE*\n" : ("Fields:" + StrPrint.printListAbbrev (fields, lineWidth, 4, false, true, true) + '\n'); String c = (constructors.size() == 0) ? "Constructors: *NONE*\n" : ("Constructors:" + StrPrint.printListAbbrev (constructors, lineWidth, 4, false, true, true) + '\n'); String ec = (enumConstants.size() == 0) ? "" : ("Enum-Constants:" + StrPrint.printListAbbrev (enumConstants, lineWidth, 4, false, true, true) + '\n'); String ae = (annotationElems.size() == 0) ? "" : ("Annotation-Elements:" + StrPrint.printListAbbrev (annotationElems, lineWidth, 4, false, true, true) + '\n'); String nt = (nestedTypes.size() == 0) ? "" : ('[' + BBLUE + StringParse.zeroPad(nestedTypes.size()) + RESET + "] Nested-Types"); return "Name [" + BYELLOW + name + RESET + "]\n" + "Package [" + BYELLOW + packageName + RESET + "]\n" + "CIET [" + BYELLOW + ciet + RESET + "]\n" + "Qualified [" + BYELLOW + fullyQualifiedName + RESET + "]\n" + "Simple [" + BYELLOW + simpleName + RESET + "]\n" + typeParams + m + f + c + ec + ae + nt + '\n';
-
-