org.umber.bellows.transform
Class AttributeQueryTransformer

java.lang.Object
  extended byorg.umber.bellows.transform.QueryTransformer
      extended byorg.umber.bellows.transform.AttributeQueryTransformer
All Implemented Interfaces:
IDatumTransformer
Direct Known Subclasses:
CopyTransformer, DeleteTransformer, MoveTransformer

public class AttributeQueryTransformer
extends QueryTransformer

Query transformer that adds handling for attributes.

Author:
jsheets

Constructor Summary
AttributeQueryTransformer(IDatumTransformer transformer)
          Creates a new instance of AttributeQueryTransformer.
 
Method Summary
protected  void applyDestinationNodes(Datum[] output, Datum[] destNodes)
          Applies all transform output nodes to all destination nodes.
protected  void deleteSourceNodes(Datum[] sourceNodes)
          Deletes all source nodes.
 void setAttributeName(java.lang.String attributeName)
          Assigns the name of the source attribute to copy.
 void setPosition(int pos)
          Determines which child index position in each destination node to insert the source node.
 
Methods inherited from class org.umber.bellows.transform.QueryTransformer
setDeleteSource, setDestinationQuery, setSourceQuery, transform
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AttributeQueryTransformer

public AttributeQueryTransformer(IDatumTransformer transformer)
Creates a new instance of AttributeQueryTransformer.

Parameters:
transformer - wrapped transformer
Method Detail

setAttributeName

public void setAttributeName(java.lang.String attributeName)
Assigns the name of the source attribute to copy. If this is set, the transformer will copy an attribute to each destination node. If this is not set, the transformer will copy whole elements.

Parameters:
attributeName - name of source node attribute

setPosition

public void setPosition(int pos)
Determines which child index position in each destination node to insert the source node. Ignored for attribute copying.

Parameters:
pos - index position to insert copies into

applyDestinationNodes

protected void applyDestinationNodes(Datum[] output,
                                     Datum[] destNodes)
Applies all transform output nodes to all destination nodes. The default implem entation appends each output node to end of each destination node's children. Subclasses can override this method to change how the output nodes are applied to the destination nodes, or in which order.

Overrides:
applyDestinationNodes in class QueryTransformer
Parameters:
output - array of transform output nodes
destNodes - array of all destination nodes

deleteSourceNodes

protected void deleteSourceNodes(Datum[] sourceNodes)
Deletes all source nodes. Subclasses can override this method to alter delete semantics.

Overrides:
deleteSourceNodes in class QueryTransformer
Parameters:
sourceNodes - all nodes selected by the source query