org.writersforge.catalan.transform.xform
Class RenameProcessor
java.lang.Object
org.writersforge.catalan.transform.BaseNodeProcessor
org.writersforge.catalan.transform.xform.XFormProcessor
org.writersforge.catalan.transform.xform.RenameProcessor
- All Implemented Interfaces:
- org.writersforge.bellows.traverse.NodeProcessor
- public class RenameProcessor
- extends XFormProcessor
A Datum-only NodeProcessor for renaming XML content. Works on element
content or on attributes.
- Author:
- jsheets
|
Constructor Summary |
RenameProcessor(org.writersforge.bellows.Datum xml)
Creates a new instance of RenameProcessor from the XML spec. |
RenameProcessor(java.lang.String query,
java.lang.String newName,
java.lang.String attribute)
Creates a new instance of RenameProcessor. |
|
Method Summary |
protected org.writersforge.bellows.Datum |
transformNode(org.writersforge.bellows.Datum node,
org.writersforge.bellows.Datum root)
Performs an in-place transformation on the supplied Datum tree. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
RenameProcessor
public RenameProcessor(org.writersforge.bellows.Datum xml)
- Creates a new instance of RenameProcessor from the XML spec.
- Parameters:
xml - XML initializing spec
RenameProcessor
public RenameProcessor(java.lang.String query,
java.lang.String newName,
java.lang.String attribute)
- Creates a new instance of RenameProcessor. If attribute is null, the
processor will rename the matching elements. If attribute is set,
the processor will rename only matching attributes.
- Parameters:
query - Bellows query path to select the source node(s)newName - the new name for the element or attributeattribute - optional attribute name
transformNode
protected org.writersforge.bellows.Datum transformNode(org.writersforge.bellows.Datum node,
org.writersforge.bellows.Datum root)
- Performs an in-place transformation on the supplied Datum tree.
- Specified by:
transformNode in class XFormProcessor
- Parameters:
node - the current node to operate uponroot - the root of the entire XML tree
- Returns:
- the new root Datum object (usually the same one)