org.umber.catalan.transform.xml
Class XmlSelectProcessor
java.lang.Object
org.umber.catalan.transform.BaseNodeProcessor
org.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
Method Summary |
java.util.List |
processNode(java.lang.Object node)
Process a single node. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
XmlSelectProcessor
public XmlSelectProcessor(Datum xml,
ProcessorRegistry registry)
- Creates a new instance of XmlSelectProcessor from the XML spec.
- Parameters:
xml
- XML initializing specregistry
- 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 wrapselect
- optional Bellows query path to limit scope when
processing XML
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)