1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
package Torello.HTML.Tools.JavaDoc;

import com.github.javaparser.ast.body.*;
import com.github.javaparser.ast.Node;

/**
 * Entity: Exhaustive list of all items that may be defined inside of a Java Type.
 * 
 * <BR /><BR />
 * <EMBED CLASS="external-html" DATA-FILE-ID="ENTITY">
 */
public enum Entity
{
    /** Denotes Field(s) */
    FIELD(Field.class, VariableDeclarator.class, "FD"),

    /** Denotes Method(s). */
    METHOD(Method.class, MethodDeclaration.class, "MD"),

    /** Denotes Constructor(s). */
    CONSTRUCTOR(Constructor.class, ConstructorDeclaration.class, "CO"),

    /**
     * Used for the 'Elements' - which <I>must be located</I> inside an Annotation Definition - but 
     * <I>are not always required or mandatory</I>.  Only an <CODE>&#64;interface</CODE>
     * ({@code Annotation}) may have "Annotation Elements".
     */
    ANNOTATION_ELEM(AnnotationElem.class, AnnotationMemberDeclaration.class, "AE"),

    /** Used for the Enumerated-Constants which may only be found inside a Java {@code 'enum'} */
    ENUM_CONSTANT(EnumConstant.class, EnumConstantDeclaration.class, "EC"),

    /**
     * Denotes Static inner-class(es), inner-interface(s), inner-enums, etc.
     * 
     * <BR /><BR /><B STYLE='color: red;'>NOTE:</B> The Type-Mirror Fields for the {@code enum}
     * constant {@code INNER_CLASS} are set to null.  Inner classes are types themselves, and the
     * 'Type-Mirror' for an inner-class would be {@code java.lang.Class.class} itself!
     */
    INNER_CLASS(NestedType.class, TypeDeclaration.class, "NT");


    // ********************************************************************************************
    // ********************************************************************************************
    // Reflection / Type java.lang.Class public constants
    // ********************************************************************************************
    // ********************************************************************************************


    /**
     * <EMBED CLASS='external-html' DATA-FILE-ID=ENTITYFIELD>
     * 
     * <BR /><BR />The <CODE>Class&lt;? extends {@link Declaration}&gt;</CODE> instance stored in
     * this <B>'Type Mirror'</B> field is just the actual <B>{@code java.lang.class}</B> of one of
     * the five CIET-Types.  Specifically this field will always evaluate to one of the following 
     * values:
     * 
     * <BR /><BR /><UL CLASS=JDUL>
     * <LI>{@code Method.class}</LI>
     * <LI>{@code Constructor.class}</LI>
     * <LI>{@code Field.class}</LI>
     * <LI>{@code EnumConstant.class}</LI>
     * <LI>{@code AnnotationElem.class}</LI>
     * <LI>{@code null} - for the {@code INNER_CLASS} constant</LI>
     * </UL>
     */
    public final Class<? extends Declaration> upgraderReflectionClass;

    /**
     * <EMBED CLASS='external-html' DATA-FILE-ID=ENTITYFIELD>
     * 
     * <BR /><BR />The {@code Class<? extends Node>} instance stored in this <B>'Type Mirror'</B>
     * field is the actual <B>{@code java.lang.Class}</B> of the Java Parser Node that is used to
     * build this kind of {@code Entity}.  Specifically, this field will always evaluate to one of
     * the following <B>Java Parser {@code com.github.javaparser.ast.body.*}</B> values:
     * 
     * <BR /><BR /><UL CLASS=JDUL>
     * <LI>{@code MethodDeclaration.class}</LI>
     * <LI>{@code ConstructorDeclaration.class}</LI>
     * <LI>{@code VariableDeclarator.class}</LI>
     * <LI>{@code EnumConstantDeclaration.class}</LI>
     * <LI>{@code AnnotationMemberDeclaration.class}</LI>
     * <LI>{@code null} - for the {@code INNER_CLASS} constant</LI>
     * </UL>
     */
    public final Class<? extends Node> javaParserReflectionClass;

    /** Two character abbreviation-string for this {@code Entity}, usefull for CSS ID's */
    public final String abbrev;

    // Private constructor
    private Entity(
            Class<? extends Declaration> upgraderReflectionClass,
            Class<? extends Node> javaParserReflectionClass,
            String abbrev
        )
    {
        this.upgraderReflectionClass    = upgraderReflectionClass;
        this.javaParserReflectionClass  = javaParserReflectionClass;
        this.abbrev                     = abbrev; 
    }
}