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 classInner class to support getDOMImplementation. -
Field Summary
FieldsModifier and TypeFieldDescriptionfinal DTMThe DTM for this node.private static final StringThe return value as Empty String.protected String(package private) static final DOMImplementationThe DOMImplementation object(package private) final intThe DTM node handle.private booleanprivate StringFields 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 NodeappendChild(Node newChild) final voidappendData(String arg) final NodecloneNode(boolean deep) shortcompareDocumentPosition(Node other) final AttrcreateAttribute(String name) final AttrcreateAttributeNS(String namespaceURI, String qualifiedName) final CDATASectioncreateCDATASection(String data) final CommentcreateComment(String data) final DocumentFragmentfinal ElementcreateElement(String tagName) final ElementcreateElementNS(String namespaceURI, String qualifiedName) final EntityReferencecreateEntityReference(String name) final ProcessingInstructioncreateProcessingInstruction(String target, String data) final TextcreateTextNode(String data) final voiddeleteData(int offset, int count) final booleanfinal booleanTest for equality based on node number.final StringgetAttribute(String name) final AttrgetAttributeNode(String name) final AttrgetAttributeNodeNS(String namespaceURI, String localName) final StringgetAttributeNS(String namespaceURI, String localName) final NamedNodeMapfinal NodeListfinal StringgetData()final DocumentTypefinal Elementfinal intNON-DOM: Return the DTM node numberfinal ElementgetElementById(String elementId) final NodeListgetElementsByTagName(String tagname) final NodeListgetElementsByTagNameNS(String namespaceURI, String localName) getFeature(String feature, String version) final Nodefinal DOMImplementationfinal Nodefinal intfinal Stringfinal StringgetName()final Stringfinal Nodefinal Stringfinal shortfinal Stringfinal Documentfinal Elementfinal Nodefinal Stringfinal Nodefinal booleanbooleanfinal Stringfinal StringgetUserData(String key) final StringgetValue()booleanbooleanhasAttribute(String name) booleanhasAttributeNS(String namespaceURI, String localName) booleanfinal booleanfinal NodeimportNode(Node importedNode, boolean deep) final NodeinsertBefore(Node newChild, Node refChild) final voidinsertData(int offset, String arg) booleanisDefaultNamespace(String namespaceURI) booleanbooleanisEqualNode(Node arg) booleanisId()booleanisSameNode(Node other) final booleanisSupported(String feature, String version) lookupNamespaceURI(String specifiedPrefix) lookupPrefix(String namespaceURI) final voidvoidfinal voidremoveAttribute(String name) final AttrremoveAttributeNode(Attr oldAttr) final voidremoveAttributeNS(String namespaceURI, String localName) final NoderemoveChild(Node oldChild) renameNode(Node n, String namespaceURI, String name) final NodereplaceChild(Node newChild, Node oldChild) final voidreplaceData(int offset, int count, String arg) replaceWholeText(String content) final voidsetAttribute(String name, String value) final AttrsetAttributeNode(Attr newAttr) final AttrsetAttributeNodeNS(Attr newAttr) final voidsetAttributeNS(String namespaceURI, String qualifiedName, String value) final voidvoidsetDocumentURI(String documentURI) voidsetIdAttribute(String name, boolean makeId) voidsetIdAttributeNode(Attr at, boolean makeId) voidsetIdAttributeNS(String namespaceURI, String localName, boolean makeId) final voidsetNodeValue(String nodeValue) final voidvoidsetStrictErrorChecking(boolean strictErrorChecking) voidsetTextContent(String textContent) setUserData(String key, Object data, UserDataHandler handler) final voidvoidsetXmlStandalone(boolean xmlStandalone) voidsetXmlVersion(String xmlVersion) final TextsplitText(int offset) final StringsubstringData(int offset, int count) private voidtraverseChildren(List<Node> listVector, Node tempNode, String tagname, boolean isTagNameWildCard) private voidtraverseChildren(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:
getNodeNamein interfaceNode
-
getTarget
- Specified by:
getTargetin interfaceProcessingInstruction
-
getLocalName
- Specified by:
getLocalNamein interfaceNode
-
getPrefix
-
setPrefix
- Specified by:
setPrefixin interfaceNode- Throws:
DOMException
-
getNamespaceURI
- Specified by:
getNamespaceURIin interfaceNode
-
isSupported
- Specified by:
isSupportedin interfaceNode
-
getNodeValue
- Specified by:
getNodeValuein interfaceNode- Throws:
DOMException
-
setNodeValue
- Specified by:
setNodeValuein interfaceNode- Throws:
DOMException
-
getNodeType
public final short getNodeType()- Specified by:
getNodeTypein interfaceNode
-
getParentNode
- Specified by:
getParentNodein interfaceNode
-
getChildNodes
- Specified by:
getChildNodesin interfaceNode
-
getFirstChild
- Specified by:
getFirstChildin interfaceNode
-
getLastChild
- Specified by:
getLastChildin interfaceNode
-
getPreviousSibling
- Specified by:
getPreviousSiblingin interfaceNode
-
getNextSibling
- Specified by:
getNextSiblingin interfaceNode
-
getAttributes
- Specified by:
getAttributesin interfaceNode
-
hasAttribute
- Specified by:
hasAttributein interfaceElement
-
hasAttributeNS
- Specified by:
hasAttributeNSin interfaceElement
-
getOwnerDocument
- Specified by:
getOwnerDocumentin interfaceNode
-
insertBefore
- Specified by:
insertBeforein interfaceNode- Throws:
DOMException
-
replaceChild
- Specified by:
replaceChildin interfaceNode- Throws:
DOMException
-
removeChild
- Specified by:
removeChildin interfaceNode- Throws:
DOMException
-
appendChild
- Specified by:
appendChildin interfaceNode- Throws:
DOMException
-
hasChildNodes
public final boolean hasChildNodes()- Specified by:
hasChildNodesin interfaceNode
-
cloneNode
-
getDoctype
- Specified by:
getDoctypein interfaceDocument
-
getImplementation
- Specified by:
getImplementationin interfaceDocument
-
getDocumentElement
- Specified by:
getDocumentElementin interfaceDocument
-
createElement
- Specified by:
createElementin interfaceDocument- Throws:
DOMException
-
createDocumentFragment
- Specified by:
createDocumentFragmentin interfaceDocument
-
createTextNode
- Specified by:
createTextNodein interfaceDocument
-
createComment
- Specified by:
createCommentin interfaceDocument
-
createCDATASection
- Specified by:
createCDATASectionin interfaceDocument- Throws:
DOMException
-
createProcessingInstruction
public final ProcessingInstruction createProcessingInstruction(String target, String data) throws DOMException - Specified by:
createProcessingInstructionin interfaceDocument- Throws:
DOMException
-
createAttribute
- Specified by:
createAttributein interfaceDocument- Throws:
DOMException
-
createEntityReference
- Specified by:
createEntityReferencein interfaceDocument- Throws:
DOMException
-
getElementsByTagName
- Specified by:
getElementsByTagNamein interfaceDocument- Specified by:
getElementsByTagNamein interfaceElement
-
traverseChildren
-
importNode
- Specified by:
importNodein interfaceDocument- Throws:
DOMException
-
createElementNS
- Specified by:
createElementNSin interfaceDocument- Throws:
DOMException
-
createAttributeNS
- Specified by:
createAttributeNSin interfaceDocument- Throws:
DOMException
-
getElementsByTagNameNS
- Specified by:
getElementsByTagNameNSin interfaceDocument- Specified by:
getElementsByTagNameNSin 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:
getElementByIdin interfaceDocument
-
splitText
- Specified by:
splitTextin interfaceText- Throws:
DOMException
-
getData
- Specified by:
getDatain interfaceCharacterData- Specified by:
getDatain interfaceProcessingInstruction- Throws:
DOMException
-
setData
- Specified by:
setDatain interfaceCharacterData- Specified by:
setDatain interfaceProcessingInstruction- Throws:
DOMException
-
getLength
public final int getLength()- Specified by:
getLengthin interfaceCharacterData
-
substringData
- Specified by:
substringDatain interfaceCharacterData- Throws:
DOMException
-
appendData
- Specified by:
appendDatain interfaceCharacterData- Throws:
DOMException
-
insertData
- Specified by:
insertDatain interfaceCharacterData- Throws:
DOMException
-
deleteData
- Specified by:
deleteDatain interfaceCharacterData- Throws:
DOMException
-
replaceData
- Specified by:
replaceDatain interfaceCharacterData- Throws:
DOMException
-
getTagName
- Specified by:
getTagNamein interfaceElement
-
getAttribute
- Specified by:
getAttributein interfaceElement
-
setAttribute
- Specified by:
setAttributein interfaceElement- Throws:
DOMException
-
removeAttribute
- Specified by:
removeAttributein interfaceElement- Throws:
DOMException
-
getAttributeNode
- Specified by:
getAttributeNodein interfaceElement
-
setAttributeNode
- Specified by:
setAttributeNodein interfaceElement- Throws:
DOMException
-
removeAttributeNode
- Specified by:
removeAttributeNodein interfaceElement- Throws:
DOMException
-
hasAttributes
public boolean hasAttributes()- Specified by:
hasAttributesin interfaceNode
-
normalize
public final void normalize() -
getAttributeNS
- Specified by:
getAttributeNSin interfaceElement
-
setAttributeNS
public final void setAttributeNS(String namespaceURI, String qualifiedName, String value) throws DOMException - Specified by:
setAttributeNSin interfaceElement- Throws:
DOMException
-
removeAttributeNS
- Specified by:
removeAttributeNSin interfaceElement- Throws:
DOMException
-
getAttributeNodeNS
- Specified by:
getAttributeNodeNSin interfaceElement
-
setAttributeNodeNS
- Specified by:
setAttributeNodeNSin interfaceElement- Throws:
DOMException
-
getName
-
getSpecified
public final boolean getSpecified()- Specified by:
getSpecifiedin interfaceAttr
-
getValue
-
setValue
-
getOwnerElement
- Specified by:
getOwnerElementin interfaceAttr
-
adoptNode
- Specified by:
adoptNodein interfaceDocument- Throws:
DOMException
-
getInputEncoding
- Specified by:
getInputEncodingin interfaceDocument
-
getStrictErrorChecking
public boolean getStrictErrorChecking()- Specified by:
getStrictErrorCheckingin interfaceDocument
-
setStrictErrorChecking
public void setStrictErrorChecking(boolean strictErrorChecking) - Specified by:
setStrictErrorCheckingin interfaceDocument
-
setUserData
- Specified by:
setUserDatain interfaceNode
-
getUserData
- Specified by:
getUserDatain interfaceNode
-
getFeature
- Specified by:
getFeaturein interfaceNode
-
isEqualNode
- Specified by:
isEqualNodein interfaceNode
-
lookupNamespaceURI
- Specified by:
lookupNamespaceURIin interfaceNode
-
isDefaultNamespace
- Specified by:
isDefaultNamespacein interfaceNode
-
lookupPrefix
- Specified by:
lookupPrefixin interfaceNode
-
isSameNode
- Specified by:
isSameNodein interfaceNode
-
setTextContent
- Specified by:
setTextContentin interfaceNode- Throws:
DOMException
-
getTextContent
- Specified by:
getTextContentin interfaceNode- Throws:
DOMException
-
compareDocumentPosition
- Specified by:
compareDocumentPositionin interfaceNode- Throws:
DOMException
-
getBaseURI
- Specified by:
getBaseURIin interfaceNode
-
renameNode
- Specified by:
renameNodein interfaceDocument- Throws:
DOMException
-
normalizeDocument
public void normalizeDocument()- Specified by:
normalizeDocumentin interfaceDocument
-
getDomConfig
- Specified by:
getDomConfigin interfaceDocument
-
setDocumentURI
- Specified by:
setDocumentURIin interfaceDocument
-
getDocumentURI
- Specified by:
getDocumentURIin interfaceDocument
-
replaceWholeText
- Specified by:
replaceWholeTextin interfaceText- Throws:
DOMException
-
getWholeText
- Specified by:
getWholeTextin interfaceText
-
isElementContentWhitespace
public boolean isElementContentWhitespace()- Specified by:
isElementContentWhitespacein interfaceText
-
setIdAttribute
- Specified by:
setIdAttributein interfaceElement
-
setIdAttributeNode
- Specified by:
setIdAttributeNodein interfaceElement
-
setIdAttributeNS
- Specified by:
setIdAttributeNSin interfaceElement
-
getSchemaTypeInfo
- Specified by:
getSchemaTypeInfoin interfaceAttr- Specified by:
getSchemaTypeInfoin interfaceElement
-
isId
public boolean isId() -
getXmlEncoding
- Specified by:
getXmlEncodingin interfaceDocument
-
getXmlStandalone
public boolean getXmlStandalone()- Specified by:
getXmlStandalonein interfaceDocument
-
setXmlStandalone
- Specified by:
setXmlStandalonein interfaceDocument- Throws:
DOMException
-
getXmlVersion
- Specified by:
getXmlVersionin interfaceDocument
-
setXmlVersion
- Specified by:
setXmlVersionin interfaceDocument- Throws:
DOMException
-