Class ParsedFile

  • All Implemented Interfaces:
    java.io.Serializable
    Direct Known Subclasses:
    JavaDocHTMLFile, JavaSourceCodeFile

    public abstract class ParsedFile
    extends java.lang.Object
    implements java.io.Serializable
    Parent-class of both JavaSourceCodeFile and JavaDocHTMLFile.

    This class is abstract and there are two primary classes which extend it. This class is designed to hold all of the information - in java.lang.String format - about a Java class, interface or enumerated type. This information generally includes lists of fields, methods and constructor declarations. This class accepts String's (in its constructor) from the two classes which extend it. Those String'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 this Upgrade Tool. The standard Java Reflection API, inside Java Package java.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 of java.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


    • Field Detail

      • serialVersionUID

        🡇    
        public static final long serialVersionUID
        This fulfils the SerialVersion UID requirement for all classes that implement Java's interface java.io.Serializable. Using the Serializable 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;
        
      • fileName

        🡅  🡇    
        public final java.lang.String fileName
        Contains the file-name from which this instance was derived
        Code:
        Exact Field Declaration Expression:
        public final String fileName;
        
      • 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 this CIET is an inner-class, the containing CIET name is included in this String field.
        For Instance:

        Input CIET 'name' Field Value
        interface 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 qualified CIET name - which means that package and containing class information is included. If thi CIET is a Java Generic that happens to have Generic Type Parameters (the 'E' in Vector<E>, this name WILL NOT include that text.

        For Instance:
        Input CIET 'fullyQualifiedName' Field Value
        interface 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 the name parameter, but leaves off both the type-parameters, and the fully-qualified package-name String's. If this CIET is an inner class the containing CIET name is included in this String field. See the table below, for details:
        Input CIET'simpleName' Field Value
        interface 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 this ParsedFile were for class java.lang.String the 'packageName' would be 'java.lang'.
        Code:
        Exact Field Declaration Expression:
        public final String packageName;
        
      • ciet

        🡅  🡇    
        public final CIET ciet
        The acronym 'CIET' simply means "Class, Interface or Enumerated-Type. This public field identifies whether this ParsedFile is for a class, an interface or an enumerated-type.
        Code:
        Exact Field Declaration Expression:
        public final CIET ciet;
        
      • isInner

        🡅  🡇    
        public final boolean isInner
        This identifies inner classes and interfaces.
        'isInner' Field Value Input 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>
        Code:
        Exact Field Declaration Expression:
        public final boolean isInner;
        
      • 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-length String[] array.
        'containerClasses' Value Input CIET
        { } interface java.lang.Integer
        { } class java.util.Vector<E>
        { "Base64" } class java.util.Base64.Decoder
        { "Map" } interface java.util.Map.Entry<K, V>
        Code:
        Exact Field Declaration Expression:
        protected final String[] containerClasses;
        
      • isGeneric

        🡅  🡇    
        public final boolean isGeneric
        This field will be TRUE anytime the genericParameters field has any elements.
        Code:
        Exact Field Declaration Expression:
        public final boolean isGeneric;
        
      • genericParameters

        🡅  🡇    
        protected final java.util.Vector<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.
        Code:
        Exact Field Declaration Expression:
        protected final Vector<String> genericParameters = new Vector<>();
        
      • methods

        🡅  🡇    
        protected final java.util.Vector<Method> methods
        This is the list of Method instances identified by the parser for this ParsedFile
        Code:
        Exact Field Declaration Expression:
        protected final Vector<Method> methods = new Vector<>();
        
      • constructors

        🡅  🡇    
        protected final java.util.Vector<Constructor> constructors
        This is the list of Constructor instances identified by the parser for this ParsedFile
        Code:
        Exact Field Declaration Expression:
        protected final Vector<Constructor> constructors = new Vector<>();
        
      • fields

        🡅  🡇    
        protected final java.util.Vector<Field> fields
        This is the list of Field instances identified by the parser for this ParsedFile
        Code:
        Exact Field Declaration Expression:
        protected final Vector<Field> fields = new Vector<>();
        
      • annotationElems

        🡅  🡇    
        protected final java.util.Vector<AnnotationElem> annotationElems
        This is the list of AnnotationElem instances identified by the parser for this ParsedFile

        IMPORTANT: The vast majority of source-files will not contain any AnnotationElem's. Unless the source-file used to build 'this' was an annotation it would simply not be possible to define an AnnotationElem for the annotation
        Code:
        Exact Field Declaration Expression:
        protected final Vector<AnnotationElem> annotationElems = new Vector<>();
        
      • enumConstants

        🡅  🡇    
        protected final java.util.Vector<EnumConstant> enumConstants
        This is the list of EnumConstant instances identified by the parser for this ParsedFile

        IMPORTANT: The vast majority of source-files will not contain any EnumConstant's. Unless the source-file used to build 'this' was an enum it would simply not be possible to define an EnumConstant for the enum
        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 of NestedType instances identified by the parser for this ParsedFile
        Code:
        Exact Field Declaration Expression:
        protected final Vector<NestedType> nestedTypes = new Vector<>();
        
    • Constructor Detail

      • ParsedFile

        🡅  🡇    
        protected ParsedFile​(java.lang.String fileName,
                             java.lang.String name,
                             java.lang.String packageName,
                             CIET ciet,
                             java.lang.String[] genericParameters,
                             java.lang.String fullyQualifiedName)
        Subclasses of 'ParsedFile' should use this constructor to initialize these fields.
        Parameters:
        name - The name of the class, interface or enumerated-type contained by this ParsedFile

        See: name.
        packageName - The package-name that holds the class, interface or enumerated-type.

        See: packageName
        ciet - Identifies what type of Java Construct is specified by this instance of 'ParsedFile'. The value will be class, interface or enumerated-type.

        See: ciet
        genericParameters - This will list any / all Type-Parameters, if this CIET happens to be a Java Generic. In most cases, this should be a zero-length String[] array. This parameter should not receive 'null', and instead should receive a zero-length array.

        See: genericParameters
        fullyQualifiedName - Should contain the fully qualified name of this CIET, and leave off the Type-Parameter text, if this happens to be a generic.
    • 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.
        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-length String[] array will be returned.
        Code:
        Exact Method Body:
         return genericParameters.toArray(new String[genericParameters.size()]);
        
      • addMethod

        🡅  🡇    
        protected final void addMethod​(Method m)
        Inserts another Method into the internal methods Vector. Both of the inheriting subclasses of this class use this method to build a list of methods for EITHER a particular '.java' source-file OR a '.html' Java Doc Web-Page.
        Parameters:
        m - Method to insert into the list of methods. Internally, the order in which these Method's are inserted is preserved. The internal data-structure used is Vector<Method>
        See Also:
        methods
        Code:
        Exact Method Body:
         methods.add(m);
        
      • numMethods

        🡅  🡇    
        public int numMethods()
        Returns the number of Method's that were successfully parsed by whichever parser was used.
        Returns:
        The number of Method's in this class' internally stored methods Vector.
        See Also:
        methods
        Code:
        Exact Method Body:
         return methods.size();
        
      • getMethod

        🡅  🡇    
        public Method getMethod​(int i)
        This will retrieve the ith Method that was defined in the original source-code ('.java') or documentation ('.html') file.
        Parameters:
        i - Index into the methods Vector
        Returns:
        The ith element of the methods Vector, as an instance of Method
        See Also:
        methods
        Code:
        Exact Method Body:
         return methods.elementAt(i);
        
      • getMethods

        🡅  🡇    
        public Method[] getMethods()
        Retrieves the complete list of Method's that were defined in the original source-code ('.java') or documentation ('.html') file.
        Returns:
        A copy of the contents of the internal methods Vector, as an array
        See Also:
        methods
        Code:
        Exact Method Body:
         return methods.toArray(new Method[methods.size()]);
        
      • getMethods

        🡅  🡇    
        public void getMethods​
                    (java.util.function.Consumer<Method> acceptMethodConsumer)
        
        Iterates the contents of the methods Vector, and sends each Method to a user-provided java.util.function.Consumer<Method>
        Parameters:
        acceptMethodConsumer - Any user-provided Consumer
        See Also:
        methods
        Code:
        Exact Method Body:
         methods.forEach((Method method) -> acceptMethodConsumer.accept(method));
        
      • addConstructor

        🡅  🡇    
        protected final void addConstructor​(Constructor c)
        Inserts another Constructor into the internal constructors Vector. Both of the inheriting subclasses of this class use this method to build a list of constructors for EITHER a particular '.java' source-file OR a '.html' Java Doc Web-Page.
        Parameters:
        c - Constructor to insert into the list of constructors. Internally, the order in which these Constructor's are inserted is preserved. The internal data-structure used is Vector<Constructor>
        See Also:
        constructors
        Code:
        Exact Method Body:
         constructors.add(c);
        
      • getConstructors

        🡅  🡇    
        public Constructor[] getConstructors()
        Retrieves the complete list of Constructor'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 the constructors Vector, and sends each Constructor to a user-provided java.util.function.Consumer<Constructor>
        Parameters:
        acceptConstructorConsumer - Any user-provided Consumer
        See Also:
        constructors
        Code:
        Exact Method Body:
         constructors.forEach
             ((Constructor constructor) -> acceptConstructorConsumer.accept(constructor));
        
      • addField

        🡅  🡇    
        protected final void addField​(Field f)
        Inserts another Field into the internal fields Vector. Both of the inheriting subclasses of this class use this method to build a list of fields for EITHER a particular '.java' source-file OR a '.html' Java Doc Web-Page.
        Parameters:
        f - Field to insert into the list of fields. Internally, the order in which these Field's are inserted is preserved. The internal data-structure used is Vector<Field>
        See Also:
        fields
        Code:
        Exact Method Body:
         fields.add(f);
        
      • numFields

        🡅  🡇    
        public int numFields()
        Returns the number of Field's that were successfully parsed by whichever parser was used.
        Returns:
        The number of Field's in this class' internally stored fields Vector.
        See Also:
        fields
        Code:
        Exact Method Body:
         return fields.size();
        
      • getField

        🡅  🡇    
        public Field getField​(int i)
        This will retrieve the ith Field that was defined in the original source-code ('.java') or documentation ('.html') file.
        Parameters:
        i - Index into the fields Vector
        Returns:
        The ith element of the fields Vector, as an instance of Field
        See Also:
        fields
        Code:
        Exact Method Body:
         return fields.elementAt(i);
        
      • getFields

        🡅  🡇    
        public Field[] getFields()
        Retrieves the complete list of Field's that were defined in the original source-code ('.java') or documentation ('.html') file.
        Returns:
        A copy of the contents of the internal fields Vector, as an array
        See Also:
        fields
        Code:
        Exact Method Body:
         return fields.toArray(new Field[fields.size()]);
        
      • getFields

        🡅  🡇    
        public void getFields​
                    (java.util.function.Consumer<Field> acceptFieldConsumer)
        
        Iterates the contents of the fields Vector, and sends each Field to a user-provided java.util.function.Consumer<Field>
        Parameters:
        acceptFieldConsumer - Any user-provided Consumer
        See Also:
        fields
        Code:
        Exact Method Body:
         fields.forEach((Field field) -> acceptFieldConsumer.accept(field));
        
      • addAnnotationElem

        🡅  🡇    
        protected final void addAnnotationElem​(AnnotationElem ae)
        Inserts another AnnotationElem into the internal annotationElems Vector. Both of the inheriting subclasses of this class use this method to build a list of annotationElems for EITHER a particular '.java' source-file OR a '.html' Java Doc Web-Page.
        Parameters:
        ae - AnnotationElem to insert into the list of annotationElems. Internally, the order in which these AnnotationElem's are inserted is preserved. The internal data-structure used is Vector<AnnotationElem>
        See Also:
        annotationElems
        Code:
        Exact Method Body:
         annotationElems.add(ae);
        
      • numAnnotationElems

        🡅  🡇    
        public int numAnnotationElems()
        Returns the number of AnnotationElem's that were successfully parsed by whichever parser was used.

        IMPORTANT: The vast majority of source-files will not contain any AnnotationElem's. Unless the source-file used to build 'this' was an annotation it would simply not be possible to define an AnnotationElem for the annotation
        Returns:
        The number of AnnotationElem's in this class' internally stored annotationElems Vector.
        See Also:
        annotationElems
        Code:
        Exact Method Body:
         return annotationElems.size();
        
      • getAnnotationElem

        🡅  🡇    
        public AnnotationElem getAnnotationElem​(int i)
        This will retrieve the ith AnnotationElem that was defined in the original source-code ('.java') or documentation ('.html') file.

        IMPORTANT: The vast majority of source-files will not contain any AnnotationElem's. Unless the source-file used to build 'this' was an annotation it would simply not be possible to define an AnnotationElem for the annotation
        Parameters:
        i - Index into the annotationElems Vector
        Returns:
        The ith element of the annotationElems Vector, as an instance of AnnotationElem
        See Also:
        annotationElems
        Code:
        Exact Method Body:
         return annotationElems.elementAt(i);
        
      • getAnnotationElems

        🡅  🡇    
        public AnnotationElem[] getAnnotationElems()
        Retrieves the complete list of AnnotationElem's that were defined in the original source-code ('.java') or documentation ('.html') file.

        IMPORTANT: The vast majority of source-files will not contain any AnnotationElem's. Unless the source-file used to build 'this' was an annotation it would simply not be possible to define an AnnotationElem for the annotation
        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 the annotationElems Vector, and sends each AnnotationElem to a user-provided java.util.function.Consumer<AnnotationElem>

        IMPORTANT: The vast majority of source-files will not contain any AnnotationElem's. Unless the source-file used to build 'this' was an annotation it would simply not be possible to define an AnnotationElem for the annotation
        Parameters:
        acceptAEConsumer - Any user-provided Consumer
        See Also:
        annotationElems
        Code:
        Exact Method Body:
         annotationElems.forEach((AnnotationElem elem) -> acceptAEConsumer.accept(elem));
        
      • addEnumConstant

        🡅  🡇    
        protected final void addEnumConstant​(EnumConstant ec)
        Inserts another EnumConstant into the internal enumConstants Vector. Both of the inheriting subclasses of this class use this method to build a list of enumConstants for EITHER a particular '.java' source-file OR a '.html' Java Doc Web-Page.

        IMPORTANT: The vast majority of source-files will not contain any EnumConstant's. Unless the source-file used to build 'this' was an enum it would simply not be possible to define an EnumConstant for the enum
        Parameters:
        ec - EnumConstant to insert into the list of enumConstants. Internally, the order in which these EnumConstant's are inserted is preserved. The internal data-structure used is Vector<EnumConstant>
        See Also:
        enumConstants
        Code:
        Exact Method Body:
         enumConstants.add(ec);
        
      • numEnumConstants

        🡅  🡇    
        public int numEnumConstants()
        Returns the number of EnumConstant's that were successfully parsed by whichever parser was used.

        IMPORTANT: The vast majority of source-files will not contain any EnumConstant's. Unless the source-file used to build 'this' was an enum it would simply not be possible to define an EnumConstant for the enum
        Returns:
        The number of EnumConstant's in this class' internally stored enumConstants Vector.
        See Also:
        enumConstants
        Code:
        Exact Method Body:
         return enumConstants.size();
        
      • getEnumConstant

        🡅  🡇    
        public EnumConstant getEnumConstant​(int i)
        This will retrieve the ith EnumConstant that was defined in the original source-code ('.java') or documentation ('.html') file.

        IMPORTANT: The vast majority of source-files will not contain any EnumConstant's. Unless the source-file used to build 'this' was an enum it would simply not be possible to define an EnumConstant for the enum
        Parameters:
        i - Index into the enumConstants Vector
        Returns:
        The ith element of the enumConstants Vector, as an instance of EnumConstant
        See Also:
        enumConstants
        Code:
        Exact Method Body:
         return enumConstants.elementAt(i);
        
      • getEnumConstants

        🡅  🡇    
        public EnumConstant[] getEnumConstants()
        Retrieves the complete list of EnumConstant's that were defined in the original source-code ('.java') or documentation ('.html') file.

        IMPORTANT: The vast majority of source-files will not contain any EnumConstant's. Unless the source-file used to build 'this' was an enum it would simply not be possible to define an EnumConstant for the enum
        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 the enumConstants Vector, and sends each EnumConstant to a user-provided java.util.function.Consumer<EnumConstant>

        IMPORTANT: The vast majority of source-files will not contain any EnumConstant's. Unless the source-file used to build 'this' was an enum it would simply not be possible to define an EnumConstant for the enum
        Parameters:
        acceptECConsumer - Any user-provided Consumer
        See Also:
        enumConstants
        Code:
        Exact Method Body:
         enumConstants.forEach((EnumConstant elem) -> acceptECConsumer.accept(elem));
        
      • addNestedType

        🡅  🡇    
        protected final void addNestedType​(NestedType nt)
        Inserts another NestedType into the internal nestedTypes Vector. Both of the inheriting subclasses of this class use this method to build a list of nestedTypes for EITHER a particular '.java' source-file OR a '.html' Java Doc Web-Page.
        Parameters:
        nt - NestedType to insert into the list of nestedTypes. Internally, the order in which these NestedType's are inserted is preserved. The internal data-structure used is Vector<NestedType>
        See Also:
        nestedTypes
        Code:
        Exact Method Body:
         nestedTypes.add(nt);
        
      • getNestedTypes

        🡅  🡇    
        public Method[] getNestedTypes()
        Retrieves the complete list of NestedType'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 the nestedTypes Vector, and sends each NestedType to a user-provided java.util.function.Consumer<NestedType>
        Parameters:
        acceptNTConsumer - Any user-provided Consumer
        See Also:
        nestedTypes
        Code:
        Exact Method Body:
         nestedTypes.forEach((NestedType type) -> acceptNTConsumer.accept(type));
        
      • findMethods

        🡅  🡇    
        public java.util.stream.Stream<MethodfindMethods​
                    (java.lang.String methodName)
        
        Returns all internally-stored Method instances whose Method#name field matches 'name'
        Parameters:
        methodName - The name of the Method
        Returns:
        An instance of Stream<Method>of all Method'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<ConstructorfindConstructors​
                    (int numParameters)
        
        Returns all internally-stored Constructor instances for instances whose accepted parameters-list has a length equal to numParameters.
        Parameters:
        numParameters - The number of parameters accepted by the Constructor being searched.
        Returns:
        An instance of Stream<Constructor> containing all Constructor'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-stored Field instance whose name matches parameter 'name'
        Parameters:
        name - The name of the Field
        Returns:
        The Field whose name matches parameter 'name'. If there is no such Field 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-stored AnnotationElem instance whose name matches parameter 'name'

        IMPORTANT: The vast majority of source-files will not contain any AnnotationElem's. Unless the source-file used to build 'this' was an annotation it would simply not be possible to define an AnnotationElem for the annotation
        Parameters:
        name - The name of the AnnotationElem
        Returns:
        The AnnotationElem whose name matches parameter 'name'. If there is no such AnnotationElem 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-stored EnumConstant instance whose name matches parameter 'name'

        IMPORTANT: The vast majority of source-files will not contain any EnumConstant's. Unless the source-file used to build 'this' was an enum it would simply not be possible to define an EnumConstant for the enum
        Parameters:
        name - The name of the EnumConstant
        Returns:
        The EnumConstant whose name matches parameter 'name'. If there is no such EnumConstant 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-stored NestedType instance whose name matches parameter 'name'
        Parameters:
        name - The name of the NestedType
        Returns:
        The NestedType whose name matches parameter 'name'. If there is no such NestedType 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 a ParsedFile result object, 'this', into a String. Passes '0' to the standard flags-print method.
        Overrides:
        toString in class java.lang.Object
        Code:
        Exact Method Body:
         return toString(0);
        
      • toString

        🡅  🡇    
        public java.lang.String toString​(int flags)
        Turns a ParsedFile result object, 'this', into a java.lang.String.

        This will check for the 'UNIX_COLORS' flag in class 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 individual toString(int flag) methods in each of the Method, 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 ? C.BRED : "") + "Methods:\n" + (c ? C.RESET : "") +
                         "******************************************************************\n"  );
        
             for (Method m : methods) sb.append(m.toString(flags) + "\n\n");
         }
        
         if (constructors.size() > 0)
         {
             sb.append(  "******************************************************************\n" + 
                         (c ? C.BRED : "") + "Constructors:\n" + (c ? C.RESET : "") +
                         "******************************************************************\n"  );
        
             for (Constructor cs : constructors)  sb.append(cs.toString(flags) + "\n\n");
         }
        
         if (fields.size() > 0)
         {
             sb.append(  "******************************************************************\n" + 
                         (c ? C.BRED : "") + "Fields:\n" + (c ? C.RESET : "") +
                         "******************************************************************\n"  );
        
             for (Field f : fields) sb.append(f.toString(flags) + "\n\n");
         }
        
         if (annotationElems.size() > 0)
         {
             sb.append(  "******************************************************************\n" + 
                         (c ? C.BRED : "") + "Annotation-Elements:\n" + (c ? C.RESET : "") +
                         "******************************************************************\n"  );
        
             for (AnnotationElem ae : annotationElems) sb.append(ae.toString(flags) + "\n\n");
         }
        
         if (enumConstants.size() > 0)
         {
             sb.append(  "******************************************************************\n" + 
                         (c ? C.BRED : "") + "Enumerated Constants:\n" + (c ? C.RESET : "") +
                         "******************************************************************\n"  );
        
             for (EnumConstant ec : enumConstants) sb.append(ec.toString(flags) + "\n\n");
         }
        
         if (nestedTypes.size() > 0)
         {
             sb.append(  "******************************************************************\n" + 
                         (c ? C.BRED : "") + "Nested Types:\n" + (c ? 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)
             ? ""
             : ('[' + C.BBLUE + StringParse.zeroPad(annotationElems.size()) + C.RESET +
                 "] Annotation-Elements");
        
         String ec = (enumConstants.size() == 0)
             ? ""
             : ('[' + C.BBLUE + StringParse.zeroPad(enumConstants.size()) + C.RESET +
                 "] Enum-Constants");
        
         String nt = (nestedTypes.size() == 0)
             ? ""
             : ('[' + C.BBLUE + StringParse.zeroPad(nestedTypes.size()) + C.RESET +
                 "] Nested-Types");
            
         return
             "Name ["        + C.BYELLOW + name                  + C.RESET + "], " + 
             "Package ["     + C.BYELLOW + packageName           + C.RESET + "], " +
             "CIET ["        + C.BYELLOW + ciet                  + C.RESET + "], " +
             "Qualified ["   + C.BYELLOW + fullyQualifiedName    + C.RESET + "], " +
             "Simple ["      + C.BYELLOW + simpleName            + C.RESET + "]\n" +
             typeParams +
             '[' + C.BBLUE + StringParse.zeroPad(fields.size())          + C.RESET + "] Fields, " +
             '[' + C.BBLUE + StringParse.zeroPad(constructors.size())    + C.RESET + "] Constructors, " +
             '[' + C.BBLUE + StringParse.zeroPad(methods.size())         + C.RESET + "] Methods" +
             ae + ec + nt + '\n';