public interface XmlNode
extends org.w3c.dom.Node
XmlDocumentATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_POSITION_CONTAINED_BY, DOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_DISCONNECTED, DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, DOCUMENT_POSITION_PRECEDING, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE| Modifier and Type | Method and Description |
|---|---|
XmlNode |
addChild(java.lang.String tagName)
Adds an instance of the specified child class to this node.
|
java.lang.String |
getAttribute(java.lang.String attribute)
Convenient method to get the value of an attribute.
|
java.util.Collection<java.lang.String> |
getAttributeNames()
Returns a collection of permitted attribute names for the node.
|
<T extends XmlNode> |
getChildNodes(java.lang.Class<T> tagClass)
Return a collection of child nodes with the specified tag class.
|
<T extends XmlNode> |
getChildren()
Return a collection of all child nodes.
|
org.w3c.dom.Node |
getNode()
Retrieves the encapsulated node.
|
java.lang.String |
getTagName()
Retrieves the name of the tag for the derived node.
|
XmlNode |
newInstance(org.w3c.dom.Node n,
XmlNodeFactory<? extends XmlNode> factory)
Create a new instance for the given node.
|
void |
setAttribute(java.lang.String name,
java.lang.String value)
Convenient method to set the value of an attribute.
|
appendChild, cloneNode, compareDocumentPosition, getAttributes, getBaseURI, getChildNodes, getFeature, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, getTextContent, getUserData, hasAttributes, hasChildNodes, insertBefore, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, removeChild, replaceChild, setNodeValue, setPrefix, setTextContent, setUserDataorg.w3c.dom.Node getNode()
java.lang.String getTagName()
XmlNode newInstance(org.w3c.dom.Node n, XmlNodeFactory<? extends XmlNode> factory)
Each XmlNode can serve as a prototype in a
XmlNodeFactory to produce a collection of
child nodes. Factories can then use the prototype pattern to
produce new nodes.
n - The node to encapsulate.factory - the factroy that calls this method.XmlNodeFactoryXmlNode addChild(java.lang.String tagName)
tagName - the tag name of the node to add without any attributes.java.lang.String getAttribute(java.lang.String attribute)
attribute - Name of the attribute.null if the value of the
attribute cannot be retrieved.void setAttribute(java.lang.String name,
java.lang.String value)
null then the attribute is removed.name - Name of the attribute.value - New value of the attribute or null to remove the
attribute.java.util.Collection<java.lang.String> getAttributeNames()
<T extends XmlNode> java.util.Collection<T> getChildNodes(java.lang.Class<T> tagClass)
T - Type of the child nodes.tagClass - Class of child node to return.<T extends XmlNode> java.util.Collection<T> getChildren()
T - Type of the child nodes.