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
package Torello.JDUInternal.DataClasses.MainLoopData;

import Torello.HTML.HTMLNode;
import Torello.HTML.TagNode;

import Torello.JavaDoc.Excuse;

import Torello.Java.ReadOnly.ReadOnlyList;
import Torello.Java.ReadOnly.ReadOnlyArrayList;

import Torello.Java.StrCSV;


/**
 * A Java Annotation-Mirror used as a 'data-class' to hold the actual values (during upgrade
 * processing) that the user has actually assigned to an Annotation inside his or her 
 * '.java' source-files.
 * 
 * NOTE: It is sort-of important to realize that this Mirror is kind of a "simpleton" thing
 *       in that all of the JDU Annotations created are declared with the @Target=ElementType.TYPE
 *       Annotation.
 * 
 * Beause of this reason, this "AnnotationsMirror" class can hold everything there is to know about
 * user JavaDoc-Upgrader User-Provided Annotations for an entire CIET/Type.  If there are ever 
 * "Method-Level" or "Field-Level" (or any one of the other ElementType @Target's), then this
 * entire Data-Class will be a somewhat more complicated.
 * 
 * Right now it looks quite elegant, and since I haven't put any effort into making @interface's
 * that have @Target(ElementType.xxx) (Where 'xxx' is anything else other than TYPE), this is going
 * to continue to be sort of simple.
 * 
 * Eventually the "@HiLiteSource" will allow targeting methods, fields and constructors, and when
 * that happens, this thing is going to have ReadOnlyTreeMap's and stuff like that...
 */
public class AnnotationsMirror
{
    // @StaticFunctional
    public final boolean                        staticFunctional;
    public final ReadOnlyList<Excuse>           excuses;
    public final ReadOnlyList<String>           excused;

    // @JDHeaderBackgroundImg Data
    public final boolean                        jdHeaderBackgroundImg;
    public final ReadOnlyArrayList<HTMLNode>    externalEmbedTags;  // calls .wrapToImmutableList()
    public final TagNode                        tnDiv;              // requires "ReadOnlyArrayList"

    // @CSSStyleSheets Data
    public final boolean                        cssLinks;
    public final ReadOnlyList<String>           fileNames;

    public AnnotationsMirror(
            final boolean                       staticFunctional,
            final ReadOnlyList<Excuse>          excuses,
            final ReadOnlyList<String>          excused,

            final boolean                       jdHeaderBackgroundImg,
            final ReadOnlyArrayList<HTMLNode>   externalEmbedTags,
            final TagNode                       tnDiv,

            final boolean                       cssLinks,
            final ReadOnlyList<String>          fileNames
        )   
    {
        this.staticFunctional       = staticFunctional;
        this.excuses                = excuses;
        this.excused                = excused;

        this.jdHeaderBackgroundImg  = jdHeaderBackgroundImg;
        this.externalEmbedTags      = externalEmbedTags;
        this.tnDiv                  = tnDiv;

        this.cssLinks               = cssLinks;
        this.fileNames              = fileNames;
    }

    public String toString()
    {
        return
            "@StaticFunctional: " + staticFunctional + '\n' +
            "excuses:           [" + StrCSV.toCSV(this.excuses, true, true, null) + "]\n" +
            "excused:           [" + StrCSV.toCSV(this.excused, true, true, null) + "]\n" +

            "@JDHeaderBkImg:    " + jdHeaderBackgroundImg + '\n' +
            "tnDiv:             " + tnDiv.str + '\n' +
            "externalEmbedTags: [" + StrCSV.toCSV(this.externalEmbedTags, true, true, null) +
                "]\n" +

            "@CSSLinks:         " + cssLinks + '\n' +
            "fileNames:         [" + StrCSV.toCSV(this.fileNames, true, true, null) + "]\n";
    }
}