Package org.htmlunit.xpath.xml.dtm.ref
Class DTMNodeProxy
java.lang.Object
org.htmlunit.xpath.xml.dtm.ref.DTMNodeProxy
- All Implemented Interfaces:
Attr
,CharacterData
,Comment
,Document
,DocumentFragment
,Element
,Node
,ProcessingInstruction
,Text
public class DTMNodeProxy
extends Object
implements Node, Document, Text, Element, Attr, ProcessingInstruction, Comment, DocumentFragment
DTMNodeProxy
presents a DOM Node API front-end to the DTM model.
It does _not_ attempt to address the "node identity" question; no effort is made to prevent the creation of multiple proxies referring to a single DTM node. Users can create a mechanism for managing this, or relinquish the use of "==" and use the .sameNodeAs() mechanism, which is under consideration for future versions of the DOM.
DTMNodeProxy may be subclassed further to present specific DOM node types.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static class
Inner class to support getDOMImplementation. -
Field Summary
FieldsModifier and TypeFieldDescriptionfinal DTM
The DTM for this node.private static final String
The return value as Empty String.protected String
(package private) static final DOMImplementation
The DOMImplementation object(package private) final int
The DTM node handle.private boolean
private String
Fields inherited from interface org.w3c.dom.Node
ATTRIBUTE_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
-
Constructor Summary
ConstructorsConstructorDescriptionDTMNodeProxy
(DTM dtm, int node) Create a DTMNodeProxy Node representing a specific Node in a DTM -
Method Summary
Modifier and TypeMethodDescriptionfinal Node
appendChild
(Node newChild) final void
appendData
(String arg) final Node
cloneNode
(boolean deep) short
compareDocumentPosition
(Node other) final Attr
createAttribute
(String name) final Attr
createAttributeNS
(String namespaceURI, String qualifiedName) final CDATASection
createCDATASection
(String data) final Comment
createComment
(String data) final DocumentFragment
final Element
createElement
(String tagName) final Element
createElementNS
(String namespaceURI, String qualifiedName) final EntityReference
createEntityReference
(String name) final ProcessingInstruction
createProcessingInstruction
(String target, String data) final Text
createTextNode
(String data) final void
deleteData
(int offset, int count) final boolean
final boolean
Test for equality based on node number.final String
getAttribute
(String name) final Attr
getAttributeNode
(String name) final Attr
getAttributeNodeNS
(String namespaceURI, String localName) final String
getAttributeNS
(String namespaceURI, String localName) final NamedNodeMap
final NodeList
final String
getData()
final DocumentType
final Element
final int
NON-DOM: Return the DTM node numberfinal Element
getElementById
(String elementId) final NodeList
getElementsByTagName
(String tagname) final NodeList
getElementsByTagNameNS
(String namespaceURI, String localName) getFeature
(String feature, String version) final Node
final DOMImplementation
final Node
final int
final String
final String
getName()
final String
final Node
final String
final short
final String
final Document
final Element
final Node
final String
final Node
final boolean
boolean
final String
final String
getUserData
(String key) final String
getValue()
boolean
boolean
hasAttribute
(String name) boolean
hasAttributeNS
(String namespaceURI, String localName) boolean
final boolean
final Node
importNode
(Node importedNode, boolean deep) final Node
insertBefore
(Node newChild, Node refChild) final void
insertData
(int offset, String arg) boolean
isDefaultNamespace
(String namespaceURI) boolean
boolean
isEqualNode
(Node arg) boolean
isId()
boolean
isSameNode
(Node other) final boolean
isSupported
(String feature, String version) lookupNamespaceURI
(String specifiedPrefix) lookupPrefix
(String namespaceURI) final void
void
final void
removeAttribute
(String name) final Attr
removeAttributeNode
(Attr oldAttr) final void
removeAttributeNS
(String namespaceURI, String localName) final Node
removeChild
(Node oldChild) renameNode
(Node n, String namespaceURI, String name) final Node
replaceChild
(Node newChild, Node oldChild) final void
replaceData
(int offset, int count, String arg) replaceWholeText
(String content) final void
setAttribute
(String name, String value) final Attr
setAttributeNode
(Attr newAttr) final Attr
setAttributeNodeNS
(Attr newAttr) final void
setAttributeNS
(String namespaceURI, String qualifiedName, String value) final void
void
setDocumentURI
(String documentURI) void
setIdAttribute
(String name, boolean makeId) void
setIdAttributeNode
(Attr at, boolean makeId) void
setIdAttributeNS
(String namespaceURI, String localName, boolean makeId) final void
setNodeValue
(String nodeValue) final void
void
setStrictErrorChecking
(boolean strictErrorChecking) void
setTextContent
(String textContent) setUserData
(String key, Object data, UserDataHandler handler) final void
void
setXmlStandalone
(boolean xmlStandalone) void
setXmlVersion
(String xmlVersion) final Text
splitText
(int offset) final String
substringData
(int offset, int count) private void
traverseChildren
(List<Node> listVector, Node tempNode, String tagname, boolean isTagNameWildCard) private void
traverseChildren
(List<Node> listVector, Node tempNode, String namespaceURI, String localname, boolean isNamespaceURIWildCard, boolean isLocalNameWildCard)
-
Field Details
-
dtm_
The DTM for this node. -
node_
final int node_The DTM node handle. -
EMPTYSTRING
The return value as Empty String.- See Also:
-
implementation
The DOMImplementation object -
fDocumentURI
-
xmlStandalone
private boolean xmlStandalone -
xmlVersion
-
-
Constructor Details
-
DTMNodeProxy
Create a DTMNodeProxy Node representing a specific Node in a DTM- Parameters:
dtm
- The DTM Reference, must be non-null.node
- The DTM node handle.
-
-
Method Details
-
getDTMNodeNumber
public final int getDTMNodeNumber()NON-DOM: Return the DTM node number- Returns:
- The DTM node handle.
-
equals
Test for equality based on node number.- Parameters:
node
- A DTM node proxy reference.- Returns:
- true if the given node has the same handle as this node.
-
equals
-
getNodeName
- Specified by:
getNodeName
in interfaceNode
-
getTarget
- Specified by:
getTarget
in interfaceProcessingInstruction
-
getLocalName
- Specified by:
getLocalName
in interfaceNode
-
getPrefix
-
setPrefix
- Specified by:
setPrefix
in interfaceNode
- Throws:
DOMException
-
getNamespaceURI
- Specified by:
getNamespaceURI
in interfaceNode
-
isSupported
- Specified by:
isSupported
in interfaceNode
-
getNodeValue
- Specified by:
getNodeValue
in interfaceNode
- Throws:
DOMException
-
setNodeValue
- Specified by:
setNodeValue
in interfaceNode
- Throws:
DOMException
-
getNodeType
public final short getNodeType()- Specified by:
getNodeType
in interfaceNode
-
getParentNode
- Specified by:
getParentNode
in interfaceNode
-
getChildNodes
- Specified by:
getChildNodes
in interfaceNode
-
getFirstChild
- Specified by:
getFirstChild
in interfaceNode
-
getLastChild
- Specified by:
getLastChild
in interfaceNode
-
getPreviousSibling
- Specified by:
getPreviousSibling
in interfaceNode
-
getNextSibling
- Specified by:
getNextSibling
in interfaceNode
-
getAttributes
- Specified by:
getAttributes
in interfaceNode
-
hasAttribute
- Specified by:
hasAttribute
in interfaceElement
-
hasAttributeNS
- Specified by:
hasAttributeNS
in interfaceElement
-
getOwnerDocument
- Specified by:
getOwnerDocument
in interfaceNode
-
insertBefore
- Specified by:
insertBefore
in interfaceNode
- Throws:
DOMException
-
replaceChild
- Specified by:
replaceChild
in interfaceNode
- Throws:
DOMException
-
removeChild
- Specified by:
removeChild
in interfaceNode
- Throws:
DOMException
-
appendChild
- Specified by:
appendChild
in interfaceNode
- Throws:
DOMException
-
hasChildNodes
public final boolean hasChildNodes()- Specified by:
hasChildNodes
in interfaceNode
-
cloneNode
-
getDoctype
- Specified by:
getDoctype
in interfaceDocument
-
getImplementation
- Specified by:
getImplementation
in interfaceDocument
-
getDocumentElement
- Specified by:
getDocumentElement
in interfaceDocument
-
createElement
- Specified by:
createElement
in interfaceDocument
- Throws:
DOMException
-
createDocumentFragment
- Specified by:
createDocumentFragment
in interfaceDocument
-
createTextNode
- Specified by:
createTextNode
in interfaceDocument
-
createComment
- Specified by:
createComment
in interfaceDocument
-
createCDATASection
- Specified by:
createCDATASection
in interfaceDocument
- Throws:
DOMException
-
createProcessingInstruction
public final ProcessingInstruction createProcessingInstruction(String target, String data) throws DOMException - Specified by:
createProcessingInstruction
in interfaceDocument
- Throws:
DOMException
-
createAttribute
- Specified by:
createAttribute
in interfaceDocument
- Throws:
DOMException
-
createEntityReference
- Specified by:
createEntityReference
in interfaceDocument
- Throws:
DOMException
-
getElementsByTagName
- Specified by:
getElementsByTagName
in interfaceDocument
- Specified by:
getElementsByTagName
in interfaceElement
-
traverseChildren
-
importNode
- Specified by:
importNode
in interfaceDocument
- Throws:
DOMException
-
createElementNS
- Specified by:
createElementNS
in interfaceDocument
- Throws:
DOMException
-
createAttributeNS
- Specified by:
createAttributeNS
in interfaceDocument
- Throws:
DOMException
-
getElementsByTagNameNS
- Specified by:
getElementsByTagNameNS
in interfaceDocument
- Specified by:
getElementsByTagNameNS
in interfaceElement
-
traverseChildren
private void traverseChildren(List<Node> listVector, Node tempNode, String namespaceURI, String localname, boolean isNamespaceURIWildCard, boolean isLocalNameWildCard) - Parameters:
listVector
-tempNode
-namespaceURI
-localname
-isNamespaceURIWildCard
-isLocalNameWildCard
-Private method to be used for recursive iterations to obtain elements by tag name and namespaceURI.
-
getElementById
- Specified by:
getElementById
in interfaceDocument
-
splitText
- Specified by:
splitText
in interfaceText
- Throws:
DOMException
-
getData
- Specified by:
getData
in interfaceCharacterData
- Specified by:
getData
in interfaceProcessingInstruction
- Throws:
DOMException
-
setData
- Specified by:
setData
in interfaceCharacterData
- Specified by:
setData
in interfaceProcessingInstruction
- Throws:
DOMException
-
getLength
public final int getLength()- Specified by:
getLength
in interfaceCharacterData
-
substringData
- Specified by:
substringData
in interfaceCharacterData
- Throws:
DOMException
-
appendData
- Specified by:
appendData
in interfaceCharacterData
- Throws:
DOMException
-
insertData
- Specified by:
insertData
in interfaceCharacterData
- Throws:
DOMException
-
deleteData
- Specified by:
deleteData
in interfaceCharacterData
- Throws:
DOMException
-
replaceData
- Specified by:
replaceData
in interfaceCharacterData
- Throws:
DOMException
-
getTagName
- Specified by:
getTagName
in interfaceElement
-
getAttribute
- Specified by:
getAttribute
in interfaceElement
-
setAttribute
- Specified by:
setAttribute
in interfaceElement
- Throws:
DOMException
-
removeAttribute
- Specified by:
removeAttribute
in interfaceElement
- Throws:
DOMException
-
getAttributeNode
- Specified by:
getAttributeNode
in interfaceElement
-
setAttributeNode
- Specified by:
setAttributeNode
in interfaceElement
- Throws:
DOMException
-
removeAttributeNode
- Specified by:
removeAttributeNode
in interfaceElement
- Throws:
DOMException
-
hasAttributes
public boolean hasAttributes()- Specified by:
hasAttributes
in interfaceNode
-
normalize
public final void normalize() -
getAttributeNS
- Specified by:
getAttributeNS
in interfaceElement
-
setAttributeNS
public final void setAttributeNS(String namespaceURI, String qualifiedName, String value) throws DOMException - Specified by:
setAttributeNS
in interfaceElement
- Throws:
DOMException
-
removeAttributeNS
- Specified by:
removeAttributeNS
in interfaceElement
- Throws:
DOMException
-
getAttributeNodeNS
- Specified by:
getAttributeNodeNS
in interfaceElement
-
setAttributeNodeNS
- Specified by:
setAttributeNodeNS
in interfaceElement
- Throws:
DOMException
-
getName
-
getSpecified
public final boolean getSpecified()- Specified by:
getSpecified
in interfaceAttr
-
getValue
-
setValue
-
getOwnerElement
- Specified by:
getOwnerElement
in interfaceAttr
-
adoptNode
- Specified by:
adoptNode
in interfaceDocument
- Throws:
DOMException
-
getInputEncoding
- Specified by:
getInputEncoding
in interfaceDocument
-
getStrictErrorChecking
public boolean getStrictErrorChecking()- Specified by:
getStrictErrorChecking
in interfaceDocument
-
setStrictErrorChecking
public void setStrictErrorChecking(boolean strictErrorChecking) - Specified by:
setStrictErrorChecking
in interfaceDocument
-
setUserData
- Specified by:
setUserData
in interfaceNode
-
getUserData
- Specified by:
getUserData
in interfaceNode
-
getFeature
- Specified by:
getFeature
in interfaceNode
-
isEqualNode
- Specified by:
isEqualNode
in interfaceNode
-
lookupNamespaceURI
- Specified by:
lookupNamespaceURI
in interfaceNode
-
isDefaultNamespace
- Specified by:
isDefaultNamespace
in interfaceNode
-
lookupPrefix
- Specified by:
lookupPrefix
in interfaceNode
-
isSameNode
- Specified by:
isSameNode
in interfaceNode
-
setTextContent
- Specified by:
setTextContent
in interfaceNode
- Throws:
DOMException
-
getTextContent
- Specified by:
getTextContent
in interfaceNode
- Throws:
DOMException
-
compareDocumentPosition
- Specified by:
compareDocumentPosition
in interfaceNode
- Throws:
DOMException
-
getBaseURI
- Specified by:
getBaseURI
in interfaceNode
-
renameNode
- Specified by:
renameNode
in interfaceDocument
- Throws:
DOMException
-
normalizeDocument
public void normalizeDocument()- Specified by:
normalizeDocument
in interfaceDocument
-
getDomConfig
- Specified by:
getDomConfig
in interfaceDocument
-
setDocumentURI
- Specified by:
setDocumentURI
in interfaceDocument
-
getDocumentURI
- Specified by:
getDocumentURI
in interfaceDocument
-
replaceWholeText
- Specified by:
replaceWholeText
in interfaceText
- Throws:
DOMException
-
getWholeText
- Specified by:
getWholeText
in interfaceText
-
isElementContentWhitespace
public boolean isElementContentWhitespace()- Specified by:
isElementContentWhitespace
in interfaceText
-
setIdAttribute
- Specified by:
setIdAttribute
in interfaceElement
-
setIdAttributeNode
- Specified by:
setIdAttributeNode
in interfaceElement
-
setIdAttributeNS
- Specified by:
setIdAttributeNS
in interfaceElement
-
getSchemaTypeInfo
- Specified by:
getSchemaTypeInfo
in interfaceAttr
- Specified by:
getSchemaTypeInfo
in interfaceElement
-
isId
public boolean isId() -
getXmlEncoding
- Specified by:
getXmlEncoding
in interfaceDocument
-
getXmlStandalone
public boolean getXmlStandalone()- Specified by:
getXmlStandalone
in interfaceDocument
-
setXmlStandalone
- Specified by:
setXmlStandalone
in interfaceDocument
- Throws:
DOMException
-
getXmlVersion
- Specified by:
getXmlVersion
in interfaceDocument
-
setXmlVersion
- Specified by:
setXmlVersion
in interfaceDocument
- Throws:
DOMException
-