Package Torello.JavaDoc
Class Declaration
- java.lang.Object
-
- Torello.JavaDoc.Declaration
-
- All Implemented Interfaces:
java.io.Serializable
- Direct Known Subclasses:
AnnotationElem
,Callable
,EnumConstant
,Field
,NestedType
public abstract class Declaration extends java.lang.Object implements java.io.Serializable
Abstract Superclass:
This class is the super-class for all Reflection-Extension Classes in this package.Reflection Class: Common-Root Ancestor Class of all Bridge Data-Classes.
Common ancestor class to all Reflection-API classes.
Reflection-Classes Inheritance-Diagram
Native JDK API Hook:
All reflection classes above, also contain an additional (transient
, non-Serializable
) field that hooks into the native Java Tree-Parser Tools available in JDK Packagecom.sun.source.tree.*
If a more in-depth Code-Analysis is needed, the JDK's AST's have full and complete Parses of your Source-Code that can facilitate almost any analysis.- See Also:
- Serialized Form
Hi-Lited Source-Code:- View Here: Torello/JavaDoc/Declaration.java
- Open New Browser-Tab: Torello/JavaDoc/Declaration.java
File Size: 22,128 Bytes Line Count: 514 '\n' Characters Found
-
-
Field Summary
Serializable ID Modifier and Type Field static long
serialVersionUID
Type-Member / Entity Enumerated-Constant (Which Declaration Sub-Class is this?) Modifier and Type Field Entity
entity
Reflection & Inspection: final-Strings Modifier and Type Field String
body
String
jdComment
String
name
String
signature
Line Number & Location Information Modifier and Type Field Location
location
Reflection & Inspection: Read-Only String-Lists Modifier and Type Field ReadOnlyList<String>
annotations
ReadOnlyList<String>
modifiers
Internally Used ID Modifier and Type Field int
id
-
-
-
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;
-
id
public final int id
For the purposes of passing these around to different parts of the code, every one of these are given a unique ID. This id is unique for a method, whether it was parsed from a detail or a summary section. This id is (probably) not useful outside of the HTML Processor Classes.
ID Clone:
If a subclass ofDeclaration
is cloned, then thisid
field is also cloned / copied.
-
name
public final java.lang.String name
The Name of the javaField
,Method
,Constructor
,EnumConstant
orAnnotationElem
. This will be a simple, standard 'Java Identifier'.
Note that the name of aConstructor
(for-example) is always just the name of the class.
This field will never be null.
-
signature
public final java.lang.String signature
The complete, declared Signature (as aString
) of theMethod
,Field
,Constructor
,EnumConstant
orAnnotationElem
.
This field would never be null.
-
jdComment
public final java.lang.String jdComment
The Java Doc Comment of this 'Entity
' (Field
,Method
,Constructor
,EnumConstant
,AnnotationElem
orNestedType
) as aString
- if one exists. The Java Doc Comment is the one defined directly above theDeclaration
.
If thisEntity
/ Member (Field, Method, Constructor
etc...) did not have a Java Doc Comment placed on it, then this field'jdComment'
will benull
.
-
body
public final java.lang.String body
The Body of this 'Entity
' (Field
,Method
,Constructor
,EnumConstant
,AnnotationElem
orNestedType
) as aString
- if one exists.
If thisEntity
/ Member (Field, Method, Constructor
etc...) did not have a body, then this field'body'
will benull
.
The'body'
of aMethod
orConstructor
is exactly the code that comprises it. If the method isabstract
, then the method will not have a body, and in such cases this field will be null. If this member / entity is aField
then the body is the initializer of theField
. Again, if there were no initializer for the field, then'body'
would also be null.
-
entity
public final Entity entity
This just stores the type ofEntity
this is. For sub-classes instances ofDeclaration
which areMethod
, this field will be equal toEntity.METHOD
. For instances of theField
sub-class, this will equalEntity.FIELD
, and so on and so forth.
Mostly, this makes code easier to read when used along-side if-statements or switch-statements. This field somewhat akin toDeclaration.getClass()
(when retrieving the specificDeclaration
sub-class type).
Reminder:
Both this class, and sub-classCallable
are declaredabstract
, and only instances of Method, Field, Constructor, etc... can be instantiated. Only non-abstract
implementations of this class need to worry about assigning this field to any real-value.
-
location
-
modifiers
public ReadOnlyList<java.lang.String> modifiers
The'modifiers'
placed on thisDeclaration
, includingString's
such as:public, static, final
etc...
-
annotations
public ReadOnlyList<java.lang.String> annotations
The'annotations'
that decorate this declaration. It is important to keep in mind that the vast majority ofMethod's, Field's, Constructor's
andEnumConstant's
inside of any CIET will not have any'annotations'
that adorn them - at all. For manyDeclaration's
thisString
-List will have a length of'0'
.
Unparsed Raw-Text:
TheString's
contained here will be the un-parsed raw text that was used in the'.java'
source code. What that means is that when aMethod, Field, EnumConstant
etc... is annotated using an annotation (starting with the'@'
-symbol), whatever text-String
the programmer actually typed next to thatMethod, Field, Constructor
orEnumConstant
- is what will be present in thisString
-List. This means that if the annotation itself has elements / parameters, they are not parsed, but they are included in theString
.
For Example:
If@SuppressWarnings({"unchecked", "rawtypes"})
were attached to a method (for example), that exactString
would be one of the elements of thisString
-array. Retrieving the'value'
element array contents"unchecked"
and"rawtypes"
is left as a parsing exercise to the programmer.
-
-
Method Detail
-
toString
public java.lang.String toString()
Dummy Method. Overriden by Concrete Sub-Classes.- Overrides:
toString
in classjava.lang.Object
- See Also:
Method.toString()
,Field.toString()
,Constructor.toString()
- Code:
- Exact Method Body:
return "Declaration is Abstract, all Concrete Sub-Classes Override this method.";
-
toString
public java.lang.String toString(int flags)
Dummy Method. Overriden by Concrete Sub-Classes.- See Also:
Method.toString(int)
,Field.toString(int)
,Constructor.toString(int)
- Code:
- Exact Method Body:
return "Declaration is Abstract, all Concrete Sub-Classes Override this method.";
-
-