Package Torello.Browser.JsonAST
Class TCE
- java.lang.Object
-
- Torello.Browser.JsonAST.Entity
-
- Torello.Browser.JsonAST.TCE
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Comparable<Entity>
- Direct Known Subclasses:
CommandNode,EventNode,TypeNode
public abstract class TCE extends Entity implements java.io.Serializable
The class class comprises the intended public facing API for theJsonAST-Package. It is easy to load the Abstract Syntax Tree's from disk by invoking thedeserializeFromJAR()method inside of classSERIALIZED_AST. Remember that the entire packageTorello.Browser.JsonASTis used primarily by a proprietary, and yet unreleased code generator, and is only made public for informational & reference purposes.
Loading the the serialized trees from the'.jar'file, perhaps, may elucidate some of Google's Browser CDP API. The nodes themselves have quite a bit of read only data available.ClassTCEserves as the common denominator for three inheriting, child classes:TypeNode,CommandNode&EventNode.
The following two tree diagrams, with explanation, are repeated verbatim across all eight AST Node Classes.Object Inheritance for AST Nodes, and RunTime Tree Organization
The Objects which are generated by the JSON Parser are converted into AST Node Object-Instances, all of which are listed here, below. An in depth study of the CDP Specification, a programmer must realize that there are actually three (possibly four) different trees functioning simultaneously. The Classes themselves have their own "Inheritance Tree." Then, additionally, by its very nature, the original JSON Spec Files are organized in a Tree Structure (as is all JSON, you may view these trees here:Browser API JSONandJavaScript API JSON
Finally, and most importantly, at RunTime as Objects Instances, themselves, are created by the Parser; they are saved into the "Abstract Syntax Tree" (AST for short). These instances are placed into this AST, by saving them intoReadOnlyList'sfrom theReadOnly Collections Framework.
Class Inheritance Tree:The diagram below shows the static class hierarchy: how the core JsonAST classes inherit from one another at the type level.
Runtime Object Instance Tree:In contrast, this diagram shows the dynamic structure at runtime: how reified instances of those same classes are organized into an AST, with parent–child container relationships.
API└─Domain├─TypeNode│ └─PPR➜ [P]roperties ➜ Generate to Java Class Fields ├─CommandNode│ ├─PPR➜ [P]arameters ➜ Generate to Java Method Parameters │ └─PPR➜ [R]eturn-Values ➜ Generate to Java Method Return Values └─EventNode└─PPR➜ [P]arameters ➜ Generate to Java "Event Class" Fields
The following sixJsonObjectproperties are mapped to the followingEntitysubclasses:Json Object Type AST Node Java Conversion "Target" Type TypeNodeConverted into Java Inner Classes / Nested Types of the Primary Domain Java-Classes Command CommandNodeConverted into Java Methods within the Primary Domain Java-Classes Event EventNodeAlso Converted into Inner Classes / Nested Types of the Primary Domain Java-Classes Property PPRConverted into typical Java Fields within the Inner Types / Nested Classes.
(See note †† below.)Parameter PPRFor Commands, these are Converted by the Code Generator into Method Parameters. For Events, these are actually also just converted into Fields of the Nested Event Class too.
(See note †† below.)Return Value PPRThese are converted (for Commands), into Return-Values for the Methods. Using the "Multi-Return Tuples" RetNdefined in theJava.Additionalpackage, it is possible (and quite common, actually) to return multiple values from a single method invocation.
(See note †† below.)
†† UnlikeTCE, Properties, Parameters, and Return-Values do not have their own dedicated AST nodes, because their content is always identical to that in base classPPR.- See Also:
- Serialized Form
Hi-Lited Source-Code:- View Here: Torello/Browser/JsonAST/TCE.java
- Open New Browser-Tab: Torello/Browser/JsonAST/TCE.java
File Size: 1,875 Bytes Line Count: 56 '\n' Characters Found
-
-
Field Summary
Serializable ID Modifier and Type Field Description protected static longserialVersionUIDGeneral Descriptive Information about this TCE Modifier and Type Field Description WhichTCEwhichContains a simple 'enum' constant which Indicates whether'this'TCE instance has been parsed a"types", "commands"or an"events"array.-
Fields inherited from class Torello.Browser.JsonAST.Entity
arrItemsTypeProp, deprecated, description, enumVals, enumValsStr, experimental, id, index, name, optional, ownerDomain, propNames, typeProp, whichEntity
-
-
Method Summary
Methods: class java.lang.Object Modifier and Type Method Description StringtoStringShort()An abbreviatedStringrepresentation of this class.-
Methods inherited from class Torello.Browser.JsonAST.Entity
compareTo, equals, exceptionLocationSummary, hashCode
-
-
-
-
Field Detail
-
serialVersionUID
protected static final long serialVersionUID
This fulfils the SerialVersion UID requirement for all classes that implement Java'sinterface java.io.Serializable. Using theSerializableImplementation 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:
protected static final long serialVersionUID = 1;
-
which
-
-
Method Detail
-
toStringShort
public java.lang.String toStringShort()
An abbreviatedStringrepresentation of this class.- Code:
- Exact Method Body:
return this.ownerDomain.ownerAPI.name + '.' + // API-Name this.ownerDomain.name + '.' + // Domain-Name this.name + ' ' + // TCE-Name "[#" + this.id + ", WhichTCE." + this.which + ']';
-
-