Package com.marklogic.dom
Class NodeImpl
- java.lang.Object
-
- com.marklogic.dom.NodeImpl
-
- All Implemented Interfaces:
Node
- Direct Known Subclasses:
AttrImpl,CharacterDataImpl,DocumentImpl,DocumentTypeImpl,ElementImpl,ProcessingInstructionImpl
public abstract class NodeImpl extends Object implements Node
A read-only W3C DOM Node implementation of MarkLogic's internal representation of a node as stored in the expanded tree cache of a forest on disk.This interface is effectively read-only: Setters and update methods inherited from
org.w3c.Nodeare not supported and will raise an exception if called.
-
-
Field Summary
Fields Modifier and Type Field Description static org.apache.commons.logging.LogLOGprotected intnodeprotected ExpandedTreetree-
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
-
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description NodeappendChild(Node newChild)Unsupported.protected StringbuiltinNSPrefix(String URI)NodecloneNode(boolean deep)CloneNode is only supported for document node.protected NodecloneNode(Document doc, boolean deep)Given a owner document, clone the nodeshortcompareDocumentPosition(Node other)NamedNodeMapgetAttributes()StringgetBaseURI()NodeListgetChildNodes()protected NodeListgetElementsByTagNameNSOrNodeName(String namespaceURI, String name, boolean nodeName)ExpandedTreegetExpandedTree()ObjectgetFeature(String feature, String version)Unsupported.NodegetFirstChild()NodegetLastChild()StringgetLocalName()StringgetNamespaceURI()protected NodegetNextChild(int node)NodegetNextSibling()abstract StringgetNodeName()shortgetNodeType()StringgetNodeValue()protected intgetNSNodeID(long ordinal)protected intgetNSNodeID(long ordinal, long minOrdinal)DocumentgetOwnerDocument()OwnerDocument of namespace attribute is created artificially, which only contains the attribute only.NodegetParentNode()StringgetPrefix()protected intgetPrefixID(int uriAtom)protected NodegetPreviousChild(int child)NodegetPreviousSibling()StringgetTextContent()Overwritten by TextImpl, CommentImpl and ProcessingInstructionImplObjectgetUserData(String key)Unsupported.booleanhasAttributes()booleanhasChildNodes()NodeinsertBefore(Node newChild, Node refChild)Unsupported.booleanisDefaultNamespace(String namespaceURI)booleanisEqualNode(Node other)booleanisSameNode(Node other)booleanisSupported(String feature, String version)StringlookupNamespaceURI(String prefix)StringlookupPrefix(String namespaceURI)protected intnextNSNodeID(int ns, long minOrdinal)voidnormalize()Unsupported.NoderemoveChild(Node oldChild)Unsupported.NodereplaceChild(Node newChild, Node oldChild)Unsupported.voidsetNodeValue(String nodeValue)Unsupported.voidsetPrefix(String prefix)Unsupported.voidsetTextContent(String textContent)Unsupported.ObjectsetUserData(String key, Object data, UserDataHandler handler)Unsupported.
-
-
-
Field Detail
-
LOG
public static final org.apache.commons.logging.Log LOG
-
tree
protected final ExpandedTree tree
-
node
protected final int node
-
-
Method Detail
-
getExpandedTree
public ExpandedTree getExpandedTree()
-
appendChild
public Node appendChild(Node newChild) throws DOMException
Unsupported.- Specified by:
appendChildin interfaceNode- Throws:
DOMException
-
cloneNode
public Node cloneNode(boolean deep)
CloneNode is only supported for document node.
-
cloneNode
protected Node cloneNode(Document doc, boolean deep)
Given a owner document, clone the node- Parameters:
doc- owner documentdeep- the flag to indicate deep clone or not- Returns:
- null
-
compareDocumentPosition
public short compareDocumentPosition(Node other) throws DOMException
- Specified by:
compareDocumentPositionin interfaceNode- Throws:
DOMException
-
getAttributes
public NamedNodeMap getAttributes()
- Specified by:
getAttributesin interfaceNode
-
getBaseURI
public String getBaseURI()
- Specified by:
getBaseURIin interfaceNode
-
getChildNodes
public NodeList getChildNodes()
- Specified by:
getChildNodesin interfaceNode
-
getFeature
public Object getFeature(String feature, String version)
Unsupported.- Specified by:
getFeaturein interfaceNode
-
getFirstChild
public Node getFirstChild()
- Specified by:
getFirstChildin interfaceNode
-
getLastChild
public Node getLastChild()
- Specified by:
getLastChildin interfaceNode
-
getLocalName
public String getLocalName()
- Specified by:
getLocalNamein interfaceNode
-
getNamespaceURI
public String getNamespaceURI()
- Specified by:
getNamespaceURIin interfaceNode
-
getNextChild
protected Node getNextChild(int node)
-
getNextSibling
public Node getNextSibling()
- Specified by:
getNextSiblingin interfaceNode
-
getNodeName
public abstract String getNodeName()
- Specified by:
getNodeNamein interfaceNode
-
getNodeType
public short getNodeType()
- Specified by:
getNodeTypein interfaceNode
-
getNodeValue
public String getNodeValue() throws DOMException
- Specified by:
getNodeValuein interfaceNode- Throws:
DOMException
-
getOwnerDocument
public Document getOwnerDocument()
OwnerDocument of namespace attribute is created artificially, which only contains the attribute only.- Specified by:
getOwnerDocumentin interfaceNode
-
getParentNode
public Node getParentNode()
- Specified by:
getParentNodein interfaceNode
-
getPrefixID
protected int getPrefixID(int uriAtom)
-
getPreviousChild
protected Node getPreviousChild(int child)
-
getPreviousSibling
public Node getPreviousSibling()
- Specified by:
getPreviousSiblingin interfaceNode
-
getTextContent
public String getTextContent() throws DOMException
Overwritten by TextImpl, CommentImpl and ProcessingInstructionImpl- Specified by:
getTextContentin interfaceNode- Throws:
DOMException
-
getUserData
public Object getUserData(String key)
Unsupported.- Specified by:
getUserDatain interfaceNode
-
hasAttributes
public boolean hasAttributes()
- Specified by:
hasAttributesin interfaceNode
-
hasChildNodes
public boolean hasChildNodes()
- Specified by:
hasChildNodesin interfaceNode
-
insertBefore
public Node insertBefore(Node newChild, Node refChild) throws DOMException
Unsupported.- Specified by:
insertBeforein interfaceNode- Throws:
DOMException
-
isDefaultNamespace
public boolean isDefaultNamespace(String namespaceURI)
Not supported for namespace declaration. Overrided by DocumentImpl and ElementImpl
- Specified by:
isDefaultNamespacein interfaceNode
-
isEqualNode
public boolean isEqualNode(Node other)
- Specified by:
isEqualNodein interfaceNode
-
isSameNode
public boolean isSameNode(Node other)
- Specified by:
isSameNodein interfaceNode
-
isSupported
public boolean isSupported(String feature, String version)
- Specified by:
isSupportedin interfaceNode
-
getNSNodeID
protected int getNSNodeID(long ordinal, long minOrdinal)
-
getNSNodeID
protected int getNSNodeID(long ordinal)
-
nextNSNodeID
protected int nextNSNodeID(int ns, long minOrdinal)
-
lookupNamespaceURI
public String lookupNamespaceURI(String prefix)
- Specified by:
lookupNamespaceURIin interfaceNode
-
lookupPrefix
public String lookupPrefix(String namespaceURI)
- Specified by:
lookupPrefixin interfaceNode
-
removeChild
public Node removeChild(Node oldChild) throws DOMException
Unsupported.- Specified by:
removeChildin interfaceNode- Throws:
DOMException
-
replaceChild
public Node replaceChild(Node newChild, Node oldChild) throws DOMException
Unsupported.- Specified by:
replaceChildin interfaceNode- Throws:
DOMException
-
setNodeValue
public void setNodeValue(String nodeValue) throws DOMException
Unsupported.- Specified by:
setNodeValuein interfaceNode- Throws:
DOMException
-
setPrefix
public void setPrefix(String prefix) throws DOMException
Unsupported.- Specified by:
setPrefixin interfaceNode- Throws:
DOMException
-
setTextContent
public void setTextContent(String textContent) throws DOMException
Unsupported.- Specified by:
setTextContentin interfaceNode- Throws:
DOMException
-
setUserData
public Object setUserData(String key, Object data, UserDataHandler handler)
Unsupported.- Specified by:
setUserDatain interfaceNode
-
getElementsByTagNameNSOrNodeName
protected NodeList getElementsByTagNameNSOrNodeName(String namespaceURI, String name, boolean nodeName)
-
-