Humboldt Alignment Editor 2.5.0

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

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.AbstractGroupNode
          extended by eu.esdihumboldt.hale.common.align.model.transformation.tree.impl.TargetNodeImpl
All Implemented Interfaces:
GroupNode, TargetNode, TransformationNode

@Immutable
public class TargetNodeImpl
extends AbstractGroupNode
implements TargetNode

Default TargetNode implementation

Author:
Simon Templer

Field Summary
 
Fields inherited from interface eu.esdihumboldt.hale.common.align.model.transformation.tree.TargetNode
ANNOTATION_RESULT, ANNOTATION_RESULT_DEFINED
 
Fields inherited from interface eu.esdihumboldt.hale.common.align.model.transformation.tree.GroupNode
ANNOTATION_CHILDREN
 
Constructor Summary
TargetNodeImpl(EntityDefinition entity, Collection<CellNode> cells, TypeDefinition parentType, int depth, GroupNode parent)
          Create a target node that is populated with assignments and children according to the given parameters.
TargetNodeImpl(EntityDefinition entity, GroupNode parent)
          Create a target node associated with the given entity definition but unpopulated.
 
Method Summary
 void accept(TransformationNodeVisitor visitor)
          Accept a transformation node visitor.
 void addAssignment(Set<String> names, CellNode cell)
          Add an assignment to the target node.
 void addChild(TargetNode node)
          Add a child to the target node.
 boolean equals(Object obj)
           
 Set<String> getAssignmentNames(CellNode assignment)
          Get the assignment names for the given cell.
 Set<CellNode> getAssignments()
          Get the assignment to this property
 ChildDefinition<?> getDefinition()
          Get the associated definition
 EntityDefinition getEntityDefinition()
          Get the full entity definition associated with the node.
 List<TargetNode> getFixedChildren()
          Get the fixed target node children, i.e.
 Object getResult()
          Get the result value of the node as assigned through a property transformation.
 int hashCode()
           
 boolean isDefined()
          Get if the node result is defined.
 void setDefined(boolean defined)
          Set the value of the result defined annotation.
 void setResult(Object value)
          Set the value of the result annotation.
 
Methods inherited from class eu.esdihumboldt.hale.common.align.model.transformation.tree.impl.AbstractGroupNode
addAnnotatedChild, getChildren, getParent
 
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.GroupNode
addAnnotatedChild, getChildren, getParent
 
Methods inherited from interface eu.esdihumboldt.hale.common.align.model.transformation.tree.TransformationNode
getAnnotation, hasAnnotations, reset, setAnnotation
 

Constructor Detail

TargetNodeImpl

public TargetNodeImpl(EntityDefinition entity,
                      Collection<CellNode> cells,
                      TypeDefinition parentType,
                      int depth,
                      GroupNode parent)
Create a target node that is populated with assignments and children according to the given parameters.

Parameters:
entity - the associated definition
cells - the cells associated with this node or its children
parentType - the type representing the root
depth - the depth down from the root node
parent - the parent node

TargetNodeImpl

public TargetNodeImpl(EntityDefinition entity,
                      GroupNode parent)
Create a target node associated with the given entity definition but unpopulated.

Parameters:
entity - the entity definition
parent - the parent node
Method Detail

addAssignment

public void addAssignment(Set<String> names,
                          CellNode cell)
Add an assignment to the target node. May only be called if the target node was created using the TargetNodeImpl(EntityDefinition, GroupNode) constructor.

Parameters:
names - the entity names associated to the assignment
cell - the cell node representing the assignment

addChild

public void addChild(TargetNode node)
Add a child to the target node. May only be called if the target node was created using the TargetNodeImpl(EntityDefinition, GroupNode) constructor.

Parameters:
node - the node to add as child, this node will be set as its parent

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)

getFixedChildren

public List<TargetNode> getFixedChildren()
Description copied from class: AbstractGroupNode
Get the fixed target node children, i.e. those that are not represented through an annotation.

Specified by:
getFixedChildren in class AbstractGroupNode
Returns:
the list of fixed child target nodes
See Also:
AbstractGroupNode.getFixedChildren()

getAssignments

public Set<CellNode> getAssignments()
Description copied from interface: TargetNode
Get the assignment to this property

Specified by:
getAssignments in interface TargetNode
Returns:
the property assignments
See Also:
TargetNode.getAssignments()

getAssignmentNames

public Set<String> getAssignmentNames(CellNode assignment)
Description copied from interface: TargetNode
Get the assignment names for the given cell. These are the names of the cell entities the node is associated to.

Specified by:
getAssignmentNames in interface TargetNode
Parameters:
assignment - the assigned cell
Returns:
the assignment names
See Also:
TargetNode.getAssignmentNames(CellNode)

getDefinition

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

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

getEntityDefinition

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

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

isDefined

public boolean isDefined()
Description copied from interface: TargetNode
Get if the node result is defined.

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

setDefined

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

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

getResult

public Object getResult()
Description copied from interface: TargetNode
Get the result value of the node as assigned through a property transformation.

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

setResult

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

Specified by:
setResult in interface TargetNode
Parameters:
value - the result value of the node
See Also:
TargetNode.setResult(Object)

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)

Humboldt Alignment Editor 2.5.0

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