Humboldt Alignment Editor 2.5.0

eu.esdihumboldt.hale.common.align.model.transformation.tree.impl
Class SourceNodeImpl

java.lang.Object
  extended by eu.esdihumboldt.hale.common.align.model.transformation.tree.impl.AbstractTransformationNode
      extended by eu.esdihumboldt.hale.common.align.model.transformation.tree.impl.SourceNodeImpl
All Implemented Interfaces:
SourceNode, TransformationNode

public class SourceNodeImpl
extends AbstractTransformationNode
implements SourceNode

Default SourceNode implementation

Author:
Simon Templer

Field Summary
 
Fields inherited from interface eu.esdihumboldt.hale.common.align.model.transformation.tree.SourceNode
ANNOTATION_CHILDREN, ANNOTATION_LEFTOVERS, ANNOTATION_PARENT, ANNOTATION_RELATIONS, ANNOTATION_VALUE, ANNOTATION_VALUE_DEFINED
 
Constructor Summary
SourceNodeImpl(EntityDefinition definition, SourceNode parent, boolean addToParent)
          Constructor for nodes not associated to a source node factory.
SourceNodeImpl(EntityDefinition definition, SourceNodeFactory sourceNodeFactory)
          Constructor
 
Method Summary
 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)
           
 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 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.
 
Methods inherited from class eu.esdihumboldt.hale.common.align.model.transformation.tree.impl.AbstractTransformationNode
getAnnotation, hasAnnotations, reset, setAnnotation
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface eu.esdihumboldt.hale.common.align.model.transformation.tree.TransformationNode
getAnnotation, hasAnnotations, reset, setAnnotation
 

Constructor Detail

SourceNodeImpl

public SourceNodeImpl(EntityDefinition definition,
                      SourceNodeFactory sourceNodeFactory)
Constructor

Parameters:
definition - the associated entity definition
sourceNodeFactory - the factory for creating new source nodes

SourceNodeImpl

public SourceNodeImpl(EntityDefinition definition,
                      SourceNode parent,
                      boolean addToParent)
Constructor for nodes not associated to a source node factory.

Parameters:
definition - the associated entity definition
parent - the parent source node
addToParent - if the created node should be added as a child to the given parent
Method Detail

getDefinition

public Definition<?> getDefinition()
Description copied from interface: SourceNode
Get the associated definition

Specified by:
getDefinition in interface SourceNode
Returns:
the type, group or property definition
See Also:
SourceNode.getDefinition()

getParent

public SourceNode getParent()
Description copied from interface: SourceNode
Get the group or property's parent

Specified by:
getParent in interface SourceNode
Returns:
the parent node or null
See Also:
SourceNode.getParent()

getEntityDefinition

public EntityDefinition getEntityDefinition()
Description copied from interface: SourceNode
Get the full entity definition associated with the node.

Specified by:
getEntityDefinition in interface SourceNode
Returns:
the entity definition
See Also:
SourceNode.getEntityDefinition()

addChild

public void addChild(SourceNode child)
Description copied from interface: SourceNode
Add a child node.

Specified by:
addChild in interface SourceNode
Parameters:
child - the child source node
See Also:
SourceNode.addChild(SourceNode)

getChildren

public Collection<SourceNode> getChildren(boolean includeAnnotated)
Description copied from interface: SourceNode
Get the node's children.

Specified by:
getChildren in interface SourceNode
Parameters:
includeAnnotated - if annotated children should be included
Returns:
the collection of child nodes
See Also:
SourceNode.getChildren(boolean)

addRelation

public void addRelation(CellNode cellNode)
Description copied from interface: SourceNode
Add a relation.

Specified by:
addRelation in interface SourceNode
Parameters:
cellNode - the cell node representing the relation
See Also:
SourceNode.addRelation(CellNode)

getRelations

public Collection<CellNode> getRelations(boolean includeAnnotated)
Description copied from interface: SourceNode
Get the relations associated to the source node.

Specified by:
getRelations in interface SourceNode
Parameters:
includeAnnotated - if annotated relations should be included
Returns:
the associated relations
See Also:
SourceNode.getRelations(boolean)

accept

public void accept(TransformationNodeVisitor visitor)
Description copied from interface: TransformationNode
Accept a transformation node visitor.

Specified by:
accept in interface TransformationNode
Parameters:
visitor - the visitor
See Also:
TransformationNode.accept(TransformationNodeVisitor)

isDefined

public boolean isDefined()
Description copied from interface: SourceNode
Get if the source node value is defined.

Specified by:
isDefined in interface SourceNode
Returns:
the value of the defined annotation, or false if it is not set
See Also:
SourceNode.isDefined()

setDefined

public void setDefined(boolean defined)
Description copied from interface: SourceNode
Set the value of the defined annotation.

Specified by:
setDefined in interface SourceNode
Parameters:
defined - if the node value is defined
See Also:
SourceNode.setDefined(boolean)

getValue

public Object getValue()
Description copied from interface: SourceNode
Get the value of the node in the context of a specific source instance.

Specified by:
getValue in interface SourceNode
Returns:
the property value associated to the node, may be null
See Also:
SourceNode.getValue()

setValue

public void setValue(Object value)
Description copied from interface: SourceNode
Set the value of the value annotation. When setting a value the value of the defined annotation is set to true.

Specified by:
setValue in interface SourceNode
Parameters:
value - the value of the node in the context of a specific source instance
See Also:
SourceNode.setValue(java.lang.Object)

setLeftovers

public void setLeftovers(Leftovers leftovers)
Description copied from interface: SourceNode
Set the left over values associated to the node's entity, but not represented by the node.

Specified by:
setLeftovers in interface SourceNode
Parameters:
leftovers - the leftovers
See Also:
SourceNode.setLeftovers(Leftovers)

getLeftovers

public Leftovers getLeftovers()
Description copied from interface: SourceNode
Get the left over values associated to the node's entity, but not represented by the node.

Specified by:
getLeftovers in interface SourceNode
Returns:
the leftovers, may be null
See Also:
SourceNode.getLeftovers()

addAnnotatedChild

public void addAnnotatedChild(SourceNode child)
Description copied from interface: SourceNode
Add a child node as annotation. This means resetting the node will remove the child.

Specified by:
addAnnotatedChild in interface SourceNode
Parameters:
child - the child node to add
See Also:
SourceNode.addAnnotatedChild(SourceNode)

addAnnotatedRelation

public void addAnnotatedRelation(CellNode relation)
Description copied from interface: SourceNode
Add a cell node as annotated relation. This means resetting the node will remove the relation.

Specified by:
addAnnotatedRelation in interface SourceNode
Parameters:
relation - the cell node representing the relation
See Also:
SourceNode.addAnnotatedRelation(CellNode)

setContext

public void setContext(TransformationContext context)
Description copied from interface: SourceNode
Set the transformation context.

Specified by:
setContext in interface SourceNode
Parameters:
context - the transformation context
See Also:
SourceNode.setContext(TransformationContext)

getContext

public TransformationContext getContext()
Description copied from interface: SourceNode
Get the associated transformation context.

Specified by:
getContext in interface SourceNode
Returns:
the transformation context, may be null
See Also:
SourceNode.getContext()

hashCode

public int hashCode()
Overrides:
hashCode in class Object
See Also:
Object.hashCode()

equals

public boolean equals(Object obj)
Overrides:
equals in class Object
See Also:
Object.equals(java.lang.Object)

setAnnotatedParent

public void setAnnotatedParent(SourceNode parent)
Description copied from interface: SourceNode
Sets an annotated parent.

Specified by:
setAnnotatedParent in interface SourceNode
Parameters:
parent - the annotated parent
See Also:
SourceNode.setAnnotatedParent(SourceNode)

getAnnotatedParent

public SourceNode getAnnotatedParent()
Description copied from interface: SourceNode
Get the annotated parent.

Specified by:
getAnnotatedParent in interface SourceNode
Returns:
the annotated parent or null if none is set
See Also:
SourceNode.setAnnotatedParent(SourceNode)

Humboldt Alignment Editor 2.5.0

Build 2012-12-03_12-30-59
Revision 9d2dd4b0318cda9f1393b1ddd390f7f792d70a2d