|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.writersforge.catalan.transform.BaseNodeProcessor
org.writersforge.catalan.transform.GroupProcessor
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.
| Constructor Summary | |
GroupProcessor(org.writersforge.bellows.Datum xml,
ProcessorRegistry registry)
Creates a new instance of GroupProcessor from the XML spec. |
|
GroupProcessor(org.writersforge.bellows.traverse.NodeProcessor[] processors,
java.lang.Integer start,
java.lang.Integer end,
java.lang.String regexp,
java.lang.Class filterClass)
Creates a new instance of GroupProcessor to operate on a given range of input elements. |
|
| Method Summary | |
void |
end(java.util.List nodes)
Ends the current traversal. |
java.util.List |
processNode(java.lang.Object node)
Process a single node. |
| Methods inherited from class org.writersforge.catalan.transform.BaseNodeProcessor |
addLeftover, getLeftovers, getNodes, start |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public GroupProcessor(org.writersforge.bellows.Datum xml,
ProcessorRegistry registry)
xml - XML initializing specregistry - mapping registry for resolving embedded processors
public GroupProcessor(org.writersforge.bellows.traverse.NodeProcessor[] processors,
java.lang.Integer start,
java.lang.Integer end,
java.lang.String regexp,
java.lang.Class filterClass)
For example, given the node list [ "zero", "one", "two", new Integer (3), new Integer (4), "five, "six" ] with a range of 1 to 6 and a class filter of java.lang.String and the Concatenator processor, the output would be [ "zero", "onetwofive", 4, 5, "six" ]. The transform affects nodes "one" through "five", and only concatenates String nodes. The filtered-out Integer nodes are shuffled to the end of the range, but not to the end of the larger input node list.
processors - processors to wrapstart - index of first node to processend - index of last node to processregexp - optional regular expression filter, can be nullfilterClass - optional class filter, can be null| Method Detail |
public java.util.List processNode(java.lang.Object node)
node - the node to process
public void end(java.util.List nodes)
end(), the processor should be ready
for the next new traversal.
end in interface org.writersforge.bellows.traverse.NodeProcessorend in class BaseNodeProcessornodes - the list of nodes that has just been traversed
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||