org.writersforge.catalan.transform
Class GroupProcessor

java.lang.Object
  |
  +--org.writersforge.catalan.transform.BaseNodeProcessor
        |
        +--org.writersforge.catalan.transform.GroupProcessor
All Implemented Interfaces:
org.writersforge.bellows.traverse.NodeProcessor

public class GroupProcessor
extends BaseNodeProcessor

Composite NodeProcessor which can combine multiple processors into a single easily referenced one. When used with Datum trees, can optionally select a subset of the current tree with a Bellows path, and only operate on that subset. This is useful for applying operations to specific nodes.

Author:
jsheets

Constructor Summary
GroupProcessor(org.writersforge.bellows.traverse.NodeProcessor[] processors, java.lang.String select)
          Creates a new instance of GroupProcessor.
 
Method Summary
 java.util.List processNode(java.lang.Object node)
          Process a single node.
 
Methods inherited from class org.writersforge.catalan.transform.BaseNodeProcessor
addLeftover, end, getLeftovers, getNodes, start
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GroupProcessor

public GroupProcessor(org.writersforge.bellows.traverse.NodeProcessor[] processors,
                      java.lang.String select)
Creates a new instance of GroupProcessor.

Parameters:
processors - processors to wrap
select - optional Bellows query path to limit scope when processing XML
Method Detail

processNode

public java.util.List processNode(java.lang.Object node)
Process a single node. The processing action can be any arbitrary task, such as text replacement, data restructuring, or even statistical gathering. The processor should return a processed version of the node; this can be the same object untouched, or the same object modified, or a new set of objects.

Parameters:
node - the node to process
Returns:
a List of processing results (can be empty)