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
package Torello.Browser.JsonAST;

import Torello.JavaDoc.Annotations.JDHeaderBackgroundImg;

import Torello.Java.ReadOnly.ReadOnlySet;

import javax.json.JsonObject;

/**
 * Class {@code TCE} serves as the common denominator for three inheriting, child classes: 
 * {@link TypeNode}, {@link CommandNode} & {@link EventNode}.
 * 
 * <EMBED CLASS='external-html' DATA-FILE-ID=AST_TREES>
 */
@JDHeaderBackgroundImg(EmbedTagFileID="AST_NODES_JDHBI")
public abstract class TCE extends Entity implements java.io.Serializable
{
    /** <EMBED CLASS='external-html' DATA-FILE-ID=SVUID> */
    protected static final long serialVersionUID = 1;

    /**
     * Contains a simple 'enum' constant which Indicates whether {@code 'this'} TCE instance has
     * been parsed a {@code "types", "commands"} or an {@code "events"} array.
     */
    public final WhichTCE which;

    // Constructs a class that represents a Java-Script 'type', 'command' or 'event'
    TCE(
            final Domain                ownerDomain,
            final JsonObject            jo,
            final WhichTCE              which,
            final ReadOnlySet<String>   extraAllowedJsonPropNames,
            final int                   index
        )
    {
        super(
            ownerDomain,
            WhichEntity.ClassTCE,
            jo,
            index,
            extraAllowedJsonPropNames
        );

        this.which = which;
    }

    /** An abbreviated {@code String} representation of this class. */
    public String toStringShort()
    {
        return
            this.ownerDomain.ownerAPI.name + '.' +  // API-Name
            this.ownerDomain.name + '.' +           // Domain-Name
            this.name + ' ' +                       // TCE-Name
            "[#" + this.id + ", WhichTCE." + this.which + ']';
    }
}