Package org.dom4j.dom
Class DOMNodeHelper
- java.lang.Object
-
- org.dom4j.dom.DOMNodeHelper
-
public class DOMNodeHelper extends java.lang.Object
DOMNodeHelper
contains a collection of utility methods for use across Node implementations.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
DOMNodeHelper.EmptyNodeList
-
Field Summary
Fields Modifier and Type Field Description static org.w3c.dom.NodeList
EMPTY_NODE_LIST
-
Constructor Summary
Constructors Modifier Constructor Description protected
DOMNodeHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
appendData(CharacterData charData, java.lang.String arg)
static void
appendElementsByTagName(java.util.List<? super Element> list, Branch parent, java.lang.String name)
static void
appendElementsByTagNameNS(java.util.List<? super Element> list, Branch parent, java.lang.String namespace, java.lang.String localName)
static org.w3c.dom.Node
appendChild(Node node, org.w3c.dom.Node newChild)
static org.w3c.dom.Attr
asDOMAttr(Node attribute)
static org.w3c.dom.Document
asDOMDocument(Document document)
static org.w3c.dom.DocumentType
asDOMDocumentType(DocumentType dt)
static org.w3c.dom.Element
asDOMElement(Node element)
static org.w3c.dom.Node
asDOMNode(Node node)
static org.w3c.dom.Text
asDOMText(CharacterData text)
static org.w3c.dom.Node
cloneNode(Node node, boolean deep)
static org.w3c.dom.NodeList
createNodeList(java.util.List<Node> list)
static void
deleteData(CharacterData charData, int offset, int count)
static org.w3c.dom.NamedNodeMap
getAttributes(Node node)
static java.lang.String
getData(CharacterData charData)
static org.w3c.dom.Node
getFirstChild(Node node)
static org.w3c.dom.NodeList
getChildNodes(Node node)
static org.w3c.dom.Node
getLastChild(Node node)
static int
getLength(CharacterData charData)
static java.lang.String
getLocalName(Node node)
static java.lang.String
getNamespaceURI(Node node)
static org.w3c.dom.Node
getNextSibling(Node node)
static java.lang.String
getNodeValue(Node node)
static org.w3c.dom.Document
getOwnerDocument(Node node)
static org.w3c.dom.Node
getParentNode(Node node)
static java.lang.String
getPrefix(Node node)
static org.w3c.dom.Node
getPreviousSibling(Node node)
static boolean
hasAttributes(Node node)
static boolean
hasChildNodes(Node node)
static org.w3c.dom.Node
insertBefore(Node node, org.w3c.dom.Node newChild, org.w3c.dom.Node refChild)
static void
insertData(CharacterData data, int offset, java.lang.String arg)
static boolean
isNodeEquals(org.w3c.dom.Node node1, org.w3c.dom.Node node2)
static boolean
isNodeSame(org.w3c.dom.Node node1, org.w3c.dom.Node node2)
static boolean
isStringEquals(java.lang.String string1, java.lang.String string2)
static boolean
isSupported(Node n, java.lang.String feature, java.lang.String version)
static void
normalize(Node node)
static void
notSupported()
Called when a method has not been implemented yetstatic org.w3c.dom.Node
removeChild(Node node, org.w3c.dom.Node oldChild)
static void
replaceData(CharacterData charData, int offset, int count, java.lang.String arg)
static org.w3c.dom.Node
replaceChild(Node node, org.w3c.dom.Node newChild, org.w3c.dom.Node oldChild)
static void
setData(CharacterData charData, java.lang.String data)
static void
setNodeValue(Node node, java.lang.String nodeValue)
static void
setPrefix(Node node, java.lang.String prefix)
static java.lang.String
substringData(CharacterData charData, int offset, int count)
static boolean
supports(Node node, java.lang.String feature, java.lang.String version)
-
-
-
Method Detail
-
supports
public static boolean supports(Node node, java.lang.String feature, java.lang.String version)
-
getNamespaceURI
public static java.lang.String getNamespaceURI(Node node)
-
getPrefix
public static java.lang.String getPrefix(Node node)
-
getLocalName
public static java.lang.String getLocalName(Node node)
-
setPrefix
public static void setPrefix(Node node, java.lang.String prefix) throws org.w3c.dom.DOMException
- Throws:
org.w3c.dom.DOMException
-
getNodeValue
public static java.lang.String getNodeValue(Node node) throws org.w3c.dom.DOMException
- Throws:
org.w3c.dom.DOMException
-
setNodeValue
public static void setNodeValue(Node node, java.lang.String nodeValue) throws org.w3c.dom.DOMException
- Throws:
org.w3c.dom.DOMException
-
getParentNode
public static org.w3c.dom.Node getParentNode(Node node)
-
getChildNodes
public static org.w3c.dom.NodeList getChildNodes(Node node)
-
getFirstChild
public static org.w3c.dom.Node getFirstChild(Node node)
-
getLastChild
public static org.w3c.dom.Node getLastChild(Node node)
-
getPreviousSibling
public static org.w3c.dom.Node getPreviousSibling(Node node)
-
getNextSibling
public static org.w3c.dom.Node getNextSibling(Node node)
-
getAttributes
public static org.w3c.dom.NamedNodeMap getAttributes(Node node)
-
getOwnerDocument
public static org.w3c.dom.Document getOwnerDocument(Node node)
-
insertBefore
public static org.w3c.dom.Node insertBefore(Node node, org.w3c.dom.Node newChild, org.w3c.dom.Node refChild) throws org.w3c.dom.DOMException
- Throws:
org.w3c.dom.DOMException
-
replaceChild
public static org.w3c.dom.Node replaceChild(Node node, org.w3c.dom.Node newChild, org.w3c.dom.Node oldChild) throws org.w3c.dom.DOMException
- Throws:
org.w3c.dom.DOMException
-
removeChild
public static org.w3c.dom.Node removeChild(Node node, org.w3c.dom.Node oldChild) throws org.w3c.dom.DOMException
- Throws:
org.w3c.dom.DOMException
-
appendChild
public static org.w3c.dom.Node appendChild(Node node, org.w3c.dom.Node newChild) throws org.w3c.dom.DOMException
- Throws:
org.w3c.dom.DOMException
-
hasChildNodes
public static boolean hasChildNodes(Node node)
-
cloneNode
public static org.w3c.dom.Node cloneNode(Node node, boolean deep)
-
normalize
public static void normalize(Node node)
-
isSupported
public static boolean isSupported(Node n, java.lang.String feature, java.lang.String version)
-
hasAttributes
public static boolean hasAttributes(Node node)
-
getData
public static java.lang.String getData(CharacterData charData) throws org.w3c.dom.DOMException
- Throws:
org.w3c.dom.DOMException
-
setData
public static void setData(CharacterData charData, java.lang.String data) throws org.w3c.dom.DOMException
- Throws:
org.w3c.dom.DOMException
-
getLength
public static int getLength(CharacterData charData)
-
substringData
public static java.lang.String substringData(CharacterData charData, int offset, int count) throws org.w3c.dom.DOMException
- Throws:
org.w3c.dom.DOMException
-
appendData
public static void appendData(CharacterData charData, java.lang.String arg) throws org.w3c.dom.DOMException
- Throws:
org.w3c.dom.DOMException
-
insertData
public static void insertData(CharacterData data, int offset, java.lang.String arg) throws org.w3c.dom.DOMException
- Throws:
org.w3c.dom.DOMException
-
deleteData
public static void deleteData(CharacterData charData, int offset, int count) throws org.w3c.dom.DOMException
- Throws:
org.w3c.dom.DOMException
-
replaceData
public static void replaceData(CharacterData charData, int offset, int count, java.lang.String arg) throws org.w3c.dom.DOMException
- Throws:
org.w3c.dom.DOMException
-
appendElementsByTagName
public static void appendElementsByTagName(java.util.List<? super Element> list, Branch parent, java.lang.String name)
-
appendElementsByTagNameNS
public static void appendElementsByTagNameNS(java.util.List<? super Element> list, Branch parent, java.lang.String namespace, java.lang.String localName)
-
createNodeList
public static org.w3c.dom.NodeList createNodeList(java.util.List<Node> list)
-
asDOMNode
public static org.w3c.dom.Node asDOMNode(Node node)
-
asDOMDocument
public static org.w3c.dom.Document asDOMDocument(Document document)
-
asDOMDocumentType
public static org.w3c.dom.DocumentType asDOMDocumentType(DocumentType dt)
-
asDOMText
public static org.w3c.dom.Text asDOMText(CharacterData text)
-
asDOMElement
public static org.w3c.dom.Element asDOMElement(Node element)
-
asDOMAttr
public static org.w3c.dom.Attr asDOMAttr(Node attribute)
-
notSupported
public static void notSupported()
Called when a method has not been implemented yet- Throws:
org.w3c.dom.DOMException
- DOCUMENT ME!
-
isStringEquals
public static boolean isStringEquals(java.lang.String string1, java.lang.String string2)
-
isNodeEquals
public static boolean isNodeEquals(org.w3c.dom.Node node1, org.w3c.dom.Node node2)
-
isNodeSame
public static boolean isNodeSame(org.w3c.dom.Node node1, org.w3c.dom.Node node2)
-
-