public class ConfigNode
extends java.lang.Object
data model
.
Constructor and Description |
---|
ConfigNode() |
ConfigNode(java.lang.String name) |
Modifier and Type | Method and Description |
---|---|
void |
addChild(ConfigNode configNode) |
void |
addPossibleValue(java.lang.String possibleValue) |
void |
addRefactoredName(java.lang.String refactoringType,
java.lang.String refactoredName) |
void |
addRefactoredTypeName(java.lang.String refactoringType,
java.lang.String refactoredTypeName) |
void |
addSimilarChildGroup(java.util.List<ConfigNode> similarChildGrup) |
void |
addSimilarTypesChildGroup(java.util.List<ConfigNode> group) |
void |
addUniqueAttributeTypeNode(ConfigNode attributeTypeNode) |
int |
countChildren()
Returns the number of child nodes or 0 if the node does not have any
children
|
boolean |
equals(java.lang.Object other) |
java.util.List<ConfigNode> |
getChildren() |
java.util.List<ConfigNode> |
getChildrenWithTypesOrWithKeysOfTypes(java.util.List<java.lang.String> typeNames)
Compiles a list of children having one of the specified types or having
type nodes with unique keys of the specified types, to be used for
iteration within templates.
|
ConfigNode |
getFirstChildWithOtherTypeNode(ConfigNode typeNode) |
ConfigNode |
getFirstChildWithTypeNode(ConfigNode typeNode) |
ConfigNode |
getFirstUniqueKeyNode() |
java.lang.String |
getName()
The name of the node
|
java.util.List<ConfigNode> |
getNonPrimitiveChildrenWithKeysOfTypes(java.util.List<java.lang.String> typeNames)
Compiles a list of non-primitive children with type nodes for which the
first unique key has one of the given types
hasNonPrimitiveChildrenWithKeysOfTypes(List) |
int |
getNumberOfIncomingReferences()
|
int |
getNumberOfOutgoingReferences()
|
int |
getNumberOfReferences()
The total number of references is the sum of
the number of incoming
references and the number of
outgoing references |
ConfigNode |
getParent()
Returns a reference to the parent node, or null in case of top-level
nodes.
|
java.util.List<java.lang.String> |
getPossibleValues()
Volatile and not yet usable.
|
java.util.List<ConfigNode> |
getPrimitiveChildrenWithTypes(java.util.List<java.lang.String> typeNames)
Compiles a list of primitive children having one of the given types
|
java.util.Map<java.lang.String,java.lang.String> |
getRefactoredNames()
The results of every name re-factoring
preprocessors applied
to the data model can be found in
this map. |
java.util.Map<java.lang.String,java.lang.String> |
getRefactoredTypeNames()
Same as
refactored names . |
java.util.List<java.util.List<ConfigNode>> |
getSimilarChildGroups()
Returns a list of the different groups of similar nodes.
|
java.util.List<java.util.List<ConfigNode>> |
getSimilarTypesChildGroups()
Returns a list of groups of child nodes with the same
type nodes |
java.lang.String |
getTypeName()
The type of the node may be either detected by one or more of the
preprocessors applied
to the data model or explicitly
defined by the author. |
ConfigNode |
getTypeNode()
If the node references another node within the same
data model , then the referenced node
will be set as the current node's type node. |
java.util.List<ConfigNode> |
getUniqueAttributeTypeNodes()
Returns a consolidated list of references to the
type nodes of each child of the current node. |
boolean |
hasChildren()
Returns true if the node has child nodes
|
boolean |
hasChildrenWithOtherTypeNode(ConfigNode typeNode)
True if the node has at least one child node which has a
type node which is different than the given type
node |
boolean |
hasChildrenWithTypeNode(ConfigNode typeNode)
True if the node has at least one child node having the referenced
type node |
boolean |
hasChildrenWithTypesOrWithKeysOfTypes(java.util.List<java.lang.String> typeNames)
Returns true if the current node has at least one child with one of the
given types or with a type node having the first unique key of the given
type
|
boolean |
hasCollections()
Returns true if the current node has at least one child node which
qualifies as a collection type.
|
boolean |
hasMappingNodes()
Returns true if the current node has at least one child node for which
the type node qualifies as a mapping node.
|
boolean |
hasNonPrimitiveChildrenWithKeysOfTypes(java.util.List<java.lang.String> typeNames)
True if the node has at least one child node which is not a
primitive and which has a type node which has at least one unique key which
has the given type name Usually works in conjunction with hasPrimitiveChildrenWithTypes(List) |
boolean |
hasNonPrimitiveTypeNodes()
|
boolean |
hasParent()
Returns true if the node is the child of another node (i.e.
|
boolean |
hasPrimitiveChildrenWithTypes(java.util.List<java.lang.String> typeNames)
|
boolean |
hasPrimitiveChildrenWithTypes(java.util.List<java.lang.String> typeNames,
java.lang.String dictionaryName)
Similar to the
hasPrimitiveChildrenWithTypes(List) method, only
it uses the node's re-factored type
name resulted from the re-factoring based on the named dictionary |
boolean |
hasSelfReferences() |
boolean |
hasSimilarChildGroups() |
boolean |
hasSimilarTypesChildGroups() |
boolean |
hasUniqueKeyNodes()
True if at least one of the child nodes has been identified as an unique
key candidate.
|
boolean |
isCollection()
The result of the collection detection analysis.
|
boolean |
isDimensionCandidate()
Any entity which has at least one field that represents an
unique key by itself (not combined with other fields) can be used as
a
dimension in a
star or
snowflake
schema.
|
boolean |
isEnum()
Not yet used - enumeration handling to be implemented
|
boolean |
isFactCandidate()
Any entity which has no
unique keys and yet a lot of references to other entities may be a
fact in a
star or
snowflake
schema.
|
boolean |
isLastChild()
True if the node has a parent node and is the last in the list of
children of its parent node
|
boolean |
isLeaf()
Returns true if the node has a parent, but has no children.
|
boolean |
isMappingNode()
If a given node has exactly two children, both referencing other entities
in the project, then the node is considered to be a mapping node.
|
boolean |
isOrphan()
|
boolean |
isPrimitive()
Provides information on weather or not the node represents a
primitive
data type
|
boolean |
isPropertyGroup()
A property group is used in some architectures to group two or more
properties of the same entity so that they may be accessed in a more
orderly fashion
|
boolean |
isRegistryEntityCandidate()
Within the scope of the CodeGen project,
Reference data
that may be altered, added to or deleted from is called a registry.
|
boolean |
isSelfReference()
Should be true if the node has at least one child node having the
type node equal to this node |
boolean |
isUniqueKey()
Provides information on weather or not the node is candidate for an
unique key
Note that only primitive types may be used as
unique keys |
void |
setChildren(java.util.List<ConfigNode> children) |
void |
setCollection(boolean isCollection) |
void |
setEnum(boolean isEnum) |
void |
setName(java.lang.String name) |
void |
setNumberOfIncomingReferences(int numberOfIncomingReferences) |
void |
setNumberOfOutgoingReferences(int numberOfOutgoingReferences) |
void |
setParent(ConfigNode parent) |
void |
setPossibleValues(java.util.List<java.lang.String> possibleValues) |
void |
setPrimitive(boolean isPrimitive) |
void |
setPropertyGroup(boolean isPropertyGroup) |
void |
setRefactoredNames(java.util.Map<java.lang.String,java.lang.String> refactoredNames) |
void |
setRefactoredTypeNames(java.util.Map<java.lang.String,java.lang.String> refactoredTypeNames) |
void |
setSelfReference(boolean isSelfReference) |
void |
setSimilarChildGroups(java.util.List<java.util.List<ConfigNode>> similarChildGroups) |
void |
setSimilarTypesChildGroups(java.util.List<java.util.List<ConfigNode>> similarTypesChildGroups) |
void |
setTypeName(java.lang.String typeName) |
void |
setTypeNode(ConfigNode typeNode) |
void |
setUniqueAttributeTypeNodes(java.util.List<ConfigNode> uniqueAttributeTypeNodes) |
void |
setUniqueKey(boolean isUniqueKey) |
public ConfigNode()
public ConfigNode(java.lang.String name)
public java.lang.String getName()
public void setName(java.lang.String name)
public java.lang.String getTypeName()
preprocessors
applied
to the data model
or explicitly
defined by the author. In case of
primitive
data types, the type name will be one of the names defined in the
primitives dictionary. In case of an
implicit data type
, the type name will be the name of the
type node
.which has been either detected or
referenced by the author. data model
, then no
preprocessor
should
be allowed to alter this name.public void setTypeName(java.lang.String typeName)
public ConfigNode getTypeNode()
data model
, then the referenced node
will be set as the current node's type node.public void setTypeNode(ConfigNode typeNode)
public int getNumberOfIncomingReferences()
public void setNumberOfIncomingReferences(int numberOfIncomingReferences)
public int getNumberOfOutgoingReferences()
public void setNumberOfOutgoingReferences(int numberOfOutgoingReferences)
public boolean isRegistryEntityCandidate()
node
is considered to be a registry
candidate if it has at least one incoming reference and the
number of incoming references
is
greater than or equal to the number of outgoing references
public int getNumberOfReferences()
the number of incoming
references
and the number of
outgoing references
public boolean isOrphan()
public java.util.Map<java.lang.String,java.lang.String> getRefactoredTypeNames()
refactored names
. May also include
language dictionary-based
re-factoring, which is useful for templates
dedicated to a particular language.public void setRefactoredTypeNames(java.util.Map<java.lang.String,java.lang.String> refactoredTypeNames)
public ConfigNode getParent()
public void setParent(ConfigNode parent)
public java.util.List<ConfigNode> getChildren()
public void setChildren(java.util.List<ConfigNode> children)
public boolean isPrimitive()
public void setPrimitive(boolean isPrimitive)
public java.util.List<java.lang.String> getPossibleValues()
public void setPossibleValues(java.util.List<java.lang.String> possibleValues)
public boolean isCollection()
public void setCollection(boolean isCollection)
public boolean isPropertyGroup()
public void setPropertyGroup(boolean isPropertyGroup)
public java.util.Map<java.lang.String,java.lang.String> getRefactoredNames()
preprocessors
applied
to the data model
can be found in
this map. fx.codegen.preprocessor.stock.NodesRefactoringCodegenPreprocessor}
,
{@link fx.codegen.preprocessor.stock.refactoringconsumers.namesrefactoringconsumers}
public void setRefactoredNames(java.util.Map<java.lang.String,java.lang.String> refactoredNames)
public void addChild(ConfigNode configNode)
public void addPossibleValue(java.lang.String possibleValue)
public void addRefactoredName(java.lang.String refactoringType, java.lang.String refactoredName)
public void addRefactoredTypeName(java.lang.String refactoringType, java.lang.String refactoredTypeName)
public boolean hasChildren()
public int countChildren()
public boolean hasParent()
public boolean hasCollections()
isCollection()
public boolean isDimensionCandidate()
public boolean isFactCandidate()
public boolean isEnum()
public void setEnum(boolean isEnum)
public boolean isUniqueKey()
primitive types
may be used as
unique keysDictionaryUniqueKeyResolvingCodegenPreprocessor
public void setUniqueKey(boolean isUniqueKey)
public java.util.List<ConfigNode> getUniqueAttributeTypeNodes()
type nodes
of each child
of the current node.
fx.codegen.preprocessor.stock.UniqueAttributeTypesCollectingCodegenPreprocessor}
public void setUniqueAttributeTypeNodes(java.util.List<ConfigNode> uniqueAttributeTypeNodes)
public void addUniqueAttributeTypeNode(ConfigNode attributeTypeNode)
public java.util.List<java.util.List<ConfigNode>> getSimilarChildGroups()
public void setSimilarChildGroups(java.util.List<java.util.List<ConfigNode>> similarChildGroups)
public void addSimilarChildGroup(java.util.List<ConfigNode> similarChildGrup)
public boolean hasSimilarChildGroups()
public java.util.List<java.util.List<ConfigNode>> getSimilarTypesChildGroups()
type nodes
SimilarTypesChildGroupsIdentifyingCodegenPreprocessor
public void setSimilarTypesChildGroups(java.util.List<java.util.List<ConfigNode>> similarTypesChildGroups)
public void addSimilarTypesChildGroup(java.util.List<ConfigNode> group)
public boolean hasSimilarTypesChildGroups()
public boolean isSelfReference()
type node
equal to this nodeSelfReferenceComputingCodegenPreprocessor
public void setSelfReference(boolean isSelfReference)
public boolean hasSelfReferences()
public boolean hasUniqueKeyNodes()
isUniqueKey()
public ConfigNode getFirstUniqueKeyNode()
public boolean hasNonPrimitiveTypeNodes()
public boolean hasMappingNodes()
isMappingNode()
,
getTypeNode()
public boolean hasChildrenWithTypeNode(ConfigNode typeNode)
type node
public ConfigNode getFirstChildWithTypeNode(ConfigNode typeNode)
hasChildrenWithTypeNode(ConfigNode)
public boolean hasChildrenWithOtherTypeNode(ConfigNode typeNode)
type node
which is different than the given type
nodepublic ConfigNode getFirstChildWithOtherTypeNode(ConfigNode typeNode)
hasChildrenWithOtherTypeNode(ConfigNode)
public boolean isMappingNode()
public boolean isLastChild()
public boolean isLeaf()
public boolean hasPrimitiveChildrenWithTypes(java.util.List<java.lang.String> typeNames)
public boolean hasPrimitiveChildrenWithTypes(java.util.List<java.lang.String> typeNames, java.lang.String dictionaryName)
hasPrimitiveChildrenWithTypes(List)
method, only
it uses the node's re-factored type
name
resulted from the re-factoring based on the named dictionaryhasPrimitiveChildrenWithTypes(List)
,
typnamesrefactoringconsumers
public boolean hasNonPrimitiveChildrenWithKeysOfTypes(java.util.List<java.lang.String> typeNames)
primitive
and which has a type node
which has at least one unique key
which
has the given type name hasPrimitiveChildrenWithTypes(List)
public boolean hasChildrenWithTypesOrWithKeysOfTypes(java.util.List<java.lang.String> typeNames)
public java.util.List<ConfigNode> getPrimitiveChildrenWithTypes(java.util.List<java.lang.String> typeNames)
hasPrimitiveChildrenWithTypes(List)
public java.util.List<ConfigNode> getNonPrimitiveChildrenWithKeysOfTypes(java.util.List<java.lang.String> typeNames)
hasNonPrimitiveChildrenWithKeysOfTypes(List)
public java.util.List<ConfigNode> getChildrenWithTypesOrWithKeysOfTypes(java.util.List<java.lang.String> typeNames)
#hasChildrenWithTypesOrWithKeysOfTypes(List)},
{@link #hasPrimitiveChildrenWithTypes(List)},
{@link #hasNonPrimitiveChildrenWithKeysOfTypes(List)}
public boolean equals(java.lang.Object other)
equals
in class java.lang.Object