public class DomNodeModifier extends Object implements XmlFieldNodeModifier
DomNodeModifier is thread safe.
| Constructor and Description |
|---|
DomNodeModifier() |
| Modifier and Type | Method and Description |
|---|---|
void |
createAttribute(XmlFieldNode node,
String attributeName,
String textContent)
Create an attribute to a node
|
XmlFieldNode |
createElement(NamespaceMap namespaces,
XmlFieldNode node,
String elementName)
Create a new element node at the end of the root node.
|
XmlFieldNode |
createElement(NamespaceMap namespaces,
XmlFieldNode node,
String elementName,
String textContent)
Create a new element node at the end of the root node.
|
XmlFieldNode |
insertBefore(XmlFieldNode contextNode,
XmlFieldNode newChild,
XmlFieldNode refChild)
Insert a node before another node.
|
XmlFieldNode |
removeAttribute(XmlFieldNode node,
String attributeName)
Remove an attribute from a specified node
|
XmlFieldNode |
removeChild(XmlFieldNode node,
XmlFieldNode oldChild)
Remove a child node
|
void |
removeChildren(XmlFieldNodeList nodesToRemove)
Remove a node list
|
public void createAttribute(XmlFieldNode node, String attributeName, String textContent)
XmlFieldNodeModifiercreateAttribute in interface XmlFieldNodeModifiernode - node where the attribute will be createdattributeName - name of the attributetextContent - text content of the attributepublic XmlFieldNode createElement(NamespaceMap namespaces, XmlFieldNode node, String elementName)
XmlFieldNodeModifiercreateElement in interface XmlFieldNodeModifiernamespaces - document namespacesnode - context nodeelementName - element namepublic XmlFieldNode createElement(NamespaceMap namespaces, XmlFieldNode node, String elementName, String textContent)
XmlFieldNodeModifiercreateElement in interface XmlFieldNodeModifiernamespaces - document namespacesnode - context nodeelementName - element nametextContent - text content of the new elementpublic XmlFieldNode insertBefore(XmlFieldNode contextNode, XmlFieldNode newChild, XmlFieldNode refChild)
XmlFieldNodeModifierinsertBefore in interface XmlFieldNodeModifiercontextNode - parent node of the nodesnewChild - node to insertrefChild - reference node where the node should be inserted beforepublic XmlFieldNode removeAttribute(XmlFieldNode node, String attributeName)
XmlFieldNodeModifierremoveAttribute in interface XmlFieldNodeModifiernode - nodeattributeName - attribute namepublic XmlFieldNode removeChild(XmlFieldNode node, XmlFieldNode oldChild)
XmlFieldNodeModifierremoveChild in interface XmlFieldNodeModifiernode - the context nodeoldChild - child to be removedpublic void removeChildren(XmlFieldNodeList nodesToRemove)
XmlFieldNodeModifierremoveChildren in interface XmlFieldNodeModifiernodesToRemove - node list of children to be removedCopyright © 2011–2014. All rights reserved.