public class SourceNodeImpl extends AbstractTransformationNode implements SourceNode
SourceNode
implementationANNOTATION_ALL_VALUES, ANNOTATION_CHILDREN, ANNOTATION_LEFTOVERS, ANNOTATION_PARENT, ANNOTATION_RELATIONS, ANNOTATION_VALUE, ANNOTATION_VALUE_DEFINED
Constructor and Description |
---|
SourceNodeImpl(EntityDefinition definition,
SourceNode parent,
boolean addToParent)
Constructor for nodes not associated to a source node factory.
|
SourceNodeImpl(EntityDefinition definition,
SourceNodeFactory sourceNodeFactory)
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
accept(TransformationNodeVisitor visitor)
Accept a transformation node visitor.
|
void |
addAnnotatedChild(SourceNode child)
Add a child node as annotation.
|
void |
addAnnotatedRelation(CellNode relation)
Add a cell node as annotated relation.
|
void |
addChild(SourceNode child)
Add a child node.
|
void |
addRelation(CellNode cellNode)
Add a relation.
|
boolean |
equals(Object obj) |
Object[] |
getAllValues()
Get all values of the node in the context of a specific source instance.
|
SourceNode |
getAnnotatedParent()
Get the annotated parent.
|
Collection<SourceNode> |
getChildren(boolean includeAnnotated)
Get the node's children.
|
TransformationContext |
getContext()
Get the associated transformation context.
|
Definition<?> |
getDefinition()
Get the associated definition
|
EntityDefinition |
getEntityDefinition()
Get the full entity definition associated with the node.
|
Leftovers |
getLeftovers()
Get the left over values associated to the node's entity, but not
represented by the node.
|
SourceNode |
getParent()
Get the group or property's parent
|
Collection<CellNode> |
getRelations(boolean includeAnnotated)
Get the relations associated to the source node.
|
Object |
getValue()
Get the value of the node in the context of a specific source instance.
|
int |
hashCode() |
boolean |
isDefined()
Get if the source node value is defined.
|
void |
setAllValues(Object... values)
Set all original values associated to that node.
|
void |
setAnnotatedParent(SourceNode parent)
Sets an annotated parent.
|
void |
setContext(TransformationContext context)
Set the transformation context.
|
void |
setDefined(boolean defined)
Set the value of the defined annotation.
|
void |
setLeftovers(Leftovers leftovers)
Set the left over values associated to the node's entity, but not
represented by the node.
|
void |
setValue(Object value)
Set the value of the value annotation.
|
getAnnotation, hasAnnotations, reset, setAnnotation
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
getAnnotation, hasAnnotations, reset, setAnnotation
public SourceNodeImpl(EntityDefinition definition, SourceNodeFactory sourceNodeFactory)
definition
- the associated entity definitionsourceNodeFactory
- the factory for creating new source nodespublic SourceNodeImpl(EntityDefinition definition, SourceNode parent, boolean addToParent)
definition
- the associated entity definitionparent
- the parent source nodeaddToParent
- if the created node should be added as a child to the
given parentpublic Definition<?> getDefinition()
SourceNode
getDefinition
in interface SourceNode
SourceNode.getDefinition()
public SourceNode getParent()
SourceNode
getParent
in interface SourceNode
null
SourceNode.getParent()
public EntityDefinition getEntityDefinition()
SourceNode
getEntityDefinition
in interface SourceNode
SourceNode.getEntityDefinition()
public void addChild(SourceNode child)
SourceNode
addChild
in interface SourceNode
child
- the child source nodeSourceNode.addChild(SourceNode)
public Collection<SourceNode> getChildren(boolean includeAnnotated)
SourceNode
getChildren
in interface SourceNode
includeAnnotated
- if annotated children should be includedSourceNode.getChildren(boolean)
public void addRelation(CellNode cellNode)
SourceNode
addRelation
in interface SourceNode
cellNode
- the cell node representing the relationSourceNode.addRelation(CellNode)
public Collection<CellNode> getRelations(boolean includeAnnotated)
SourceNode
getRelations
in interface SourceNode
includeAnnotated
- if annotated relations should be includedSourceNode.getRelations(boolean)
public void accept(TransformationNodeVisitor visitor)
TransformationNode
accept
in interface TransformationNode
visitor
- the visitorTransformationNode.accept(TransformationNodeVisitor)
public boolean isDefined()
SourceNode
isDefined
in interface SourceNode
false
if it
is not setSourceNode.isDefined()
public void setDefined(boolean defined)
SourceNode
setDefined
in interface SourceNode
defined
- if the node value is definedSourceNode.setDefined(boolean)
public Object getValue()
SourceNode
getValue
in interface SourceNode
null
SourceNode.getValue()
public void setValue(Object value)
SourceNode
true
. Will also set the all
values annotation if it is not set yet.setValue
in interface SourceNode
value
- the value of the node in the context of a specific source
instanceSourceNode.setValue(java.lang.Object)
public void setAllValues(Object... values)
SourceNode
setAllValues
in interface SourceNode
values
- all values of the node in the context of a specific source
instanceSourceNode.ANNOTATION_ALL_VALUES
public Object[] getAllValues()
SourceNode
getAllValues
in interface SourceNode
null
SourceNode.ANNOTATION_ALL_VALUES
public void setLeftovers(Leftovers leftovers)
SourceNode
setLeftovers
in interface SourceNode
leftovers
- the leftoversSourceNode.setLeftovers(Leftovers)
public Leftovers getLeftovers()
SourceNode
getLeftovers
in interface SourceNode
null
SourceNode.getLeftovers()
public void addAnnotatedChild(SourceNode child)
SourceNode
addAnnotatedChild
in interface SourceNode
child
- the child node to addSourceNode.addAnnotatedChild(SourceNode)
public void addAnnotatedRelation(CellNode relation)
SourceNode
addAnnotatedRelation
in interface SourceNode
relation
- the cell node representing the relationSourceNode.addAnnotatedRelation(CellNode)
public void setContext(TransformationContext context)
SourceNode
setContext
in interface SourceNode
context
- the transformation contextSourceNode.setContext(TransformationContext)
public TransformationContext getContext()
SourceNode
getContext
in interface SourceNode
null
SourceNode.getContext()
public int hashCode()
hashCode
in class Object
Object.hashCode()
public boolean equals(Object obj)
equals
in class Object
Object.equals(java.lang.Object)
public void setAnnotatedParent(SourceNode parent)
SourceNode
setAnnotatedParent
in interface SourceNode
parent
- the annotated parentSourceNode.setAnnotatedParent(SourceNode)
public SourceNode getAnnotatedParent()
SourceNode
getAnnotatedParent
in interface SourceNode
SourceNode.setAnnotatedParent(SourceNode)
Build 2013-10-07_11-27-38
Revision 99b27713a799a59a21b0b166eaaea8aaefbf125a