public final class DataModelWorker extends AbstractConversionWorker implements DataModelTokenTypes
| Modifier and Type | Class and Description |
|---|---|
private static class |
DataModelWorker.ClassComparator
Comparator implementation which sorts ASTs which represent data model
object (DMO) classes.
|
static class |
DataModelWorker.DMOElementInfo
A simple helper class to load the content of a dmo_index.xml file, without having to know
all the semantics of the nodes.
|
class |
DataModelWorker.Library
Helper to create, edit, move and delete data model ASTs.
|
private static class |
DataModelWorker.PropertyComparator
Comparator implementation which sorts ASTs which have an "order"
annotation into ascending order, according to the numeric value of
that attribute.
|
private static class |
DataModelWorker.WorkArea
Context local work area.
|
| Modifier and Type | Field and Description |
|---|---|
private static ContextLocal<DataModelWorker.WorkArea> |
context
Context local work area.
|
private static ConversionStatus |
LOG
Logger.
|
private static java.lang.String |
P2O_POSTFIX
File extension appended to schema filenames
|
PEER_IDBOOL_FALSE, BOOL_TRUE, CLASS, COMPOSITE, CONSTR_COL, DATA_MODEL, DATE_LITERAL, DATETIME_LITERAL, DATETIME_TZ_LITERAL, DEC_LITERAL, FOREIGN, GENERATOR, INDEX, INDEX_COL, INITIAL, MANY_TO_ONE, NULL_LITERAL, NUM_LITERAL, ONE_TO_MANY, ONE_TO_ONE, PRIMARY, PROPERTY, RELATION_COL, SEQUENCE, STRING, TABLE, TRIGGER, UNIQUE, UNKNOWN| Constructor and Description |
|---|
DataModelWorker()
Default constructor which initializes libraries.
|
| Modifier and Type | Method and Description |
|---|---|
static DataModelAst |
createAst(int type,
java.lang.String text,
Aast parent,
AstSymbolResolver resolver)
Worker routine to centralize creation of new data model ASTs.
|
static DataModelAst |
createPeerAst(Aast source,
int type,
java.lang.String text,
Aast parent,
AstSymbolResolver resolver)
Worker routine for peer AST creation.
|
Aast |
createRootAst(Aast peerRoot,
boolean virtualFile)
Worker routine to centralize creation of a new data model AST that is
a root node.
|
Aast |
createRootAst(Aast peerRoot,
java.lang.String filename,
boolean virtualFile)
Worker routine to centralize creation of a new data model AST that is
a root node.
|
void |
finish()
Hook to provide termination processing for a pattern worker.
|
private java.lang.String |
generateFilename(Aast ast)
Generate a unique data model AST persistence filename based on the
current source AST filename.
|
private boolean |
isXDependentUponY(Aast x,
Aast y)
Tests one class AST for dependence upon another.
|
java.lang.Object |
resolveConstant(java.lang.String constant)
Resolve
constant to a literal which can be compiled into
expressions. |
crossReferencePeerAsts, getClosestPeerId, getParentPeer, initializeAst, initializeAst, initializeRootAst, initializeRootAstgetCopy, getLibrary, getResolver, getSource, isConditionalRuleSets, isFlagActivated, isRuntimeQueryMode, registerTree, setLibraryclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitinitialize, leaveAst, visitAstprivate static final ConversionStatus LOG
private static final java.lang.String P2O_POSTFIX
private static final ContextLocal<DataModelWorker.WorkArea> context
public DataModelWorker()
public static DataModelAst createAst(int type, java.lang.String text, Aast parent, AstSymbolResolver resolver)
type - The token type for the data model AST.text - The text for the AST.parent - The parent AST node or null.resolver - The current instance of the AstSymbolResolver in use
or null.public static DataModelAst createPeerAst(Aast source, int type, java.lang.String text, Aast parent, AstSymbolResolver resolver)
type - The token type for the AST.text - The text for the AST.parent - The parent AST node.resolver - The current instance of the AstSymbolResolver in use.public Aast createRootAst(Aast peerRoot, boolean virtualFile) throws ConfigurationException
AstManager
and set into the AST.peerRoot - Root node of Progress schema AST currently being processed.virtualFile - If true the file is not supposed to be persisted into the file system,
the file name is used to map some ID to the ASTConfigurationException - if P2J environment is not properly initialized.public Aast createRootAst(Aast peerRoot, java.lang.String filename, boolean virtualFile) throws ConfigurationException
AstManager
and set into the AST.peerRoot - Root node of Progress schema AST currently being processed.filename - The file in which to persist the new AST.virtualFile - If true the file is not supposed to be persisted into the file system,
the file name is used to map some ID to the ASTConfigurationException - if P2J environment is not properly initialized.public java.lang.Object resolveConstant(java.lang.String constant)
constant to a literal which can be compiled into
expressions.resolveConstant in interface PatternWorkerresolveConstant in class AbstractPatternWorkerconstant - Constant indicating a data model token name.public void finish()
finish in interface PatternWorkerprivate java.lang.String generateFilename(Aast ast)
ast - Current source AST.private boolean isXDependentUponY(Aast x, Aast y)
x, as well as the entire tree
of its dependencies. In other words, test whether x or
any class upon which it is dependent is dependent upon
y.x - Class AST node whose dependencies are being checked.y - Class AST node against which to test x for
dependence.true if x (or any of its dependent
classes) is dependent upon y.