org.umber.catalan.transform.xml
Class XmlSelectProcessor

java.lang.Object
  extended byorg.umber.catalan.transform.BaseNodeProcessor
      extended byorg.umber.catalan.transform.xml.XmlSelectProcessor
All Implemented Interfaces:
INodeProcessor

public class XmlSelectProcessor
extends BaseNodeProcessor

Composite INodeProcessor which can 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
XmlSelectProcessor(Datum xml, ProcessorRegistry registry)
          Creates a new instance of XmlSelectProcessor from the XML spec.
XmlSelectProcessor(INodeProcessor[] processors, java.lang.String select)
          Creates a new instance of XmlSelectProcessor.
 
Method Summary
 java.util.List processNode(java.lang.Object node)
          Process a single node.
 
Methods inherited from class org.umber.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

XmlSelectProcessor

public XmlSelectProcessor(Datum xml,
                          ProcessorRegistry registry)
Creates a new instance of XmlSelectProcessor from the XML spec.

Parameters:
xml - XML initializing spec
registry - mapping registry for resolving embedded processors

XmlSelectProcessor

public XmlSelectProcessor(INodeProcessor[] processors,
                          java.lang.String select)
Creates a new instance of XmlSelectProcessor.

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)