Package com.marklogic.dom
Class DocumentImpl
- java.lang.Object
-
- com.marklogic.dom.NodeImpl
-
- com.marklogic.dom.DocumentImpl
-
public class DocumentImpl extends NodeImpl implements Document
A read-only W3C DOM Node implementation of MarkLogic's internal representation of an XML or text document 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. To create a modifiable copy of a node for XML document, usecloneNode(boolean). Text document cannot be cloned.
-
-
Field Summary
Fields Modifier and Type Field Description static org.apache.commons.logging.LogLOG-
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
Constructors Constructor Description DocumentImpl(ExpandedTree tree, int node)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description NodeadoptNode(Node arg0)Unsupported.NodecloneNode(boolean deep)CloneNode is only supported for document node.AttrcreateAttribute(String arg0)Unsupported.AttrcreateAttributeNS(String arg0, String arg1)Unsupported.CDATASectioncreateCDATASection(String arg0)Unsupported.CommentcreateComment(String arg0)Unsupported.DocumentFragmentcreateDocumentFragment()Unsupported.ElementcreateElement(String arg0)Unsupported.ElementcreateElementNS(String arg0, String arg1)Unsupported.EntityReferencecreateEntityReference(String arg0)Unsupported.ProcessingInstructioncreateProcessingInstruction(String arg0, String arg1)Unsupported.TextcreateTextNode(String arg0)Unsupported.NodeListgetChildNodes()DocumentTypegetDoctype()Returns a dummy DocumentTypeImpl object that contains nothing.ElementgetDocumentElement()StringgetDocumentURI()DOMConfigurationgetDomConfig()Unsupported.ElementgetElementById(String arg0)Unsupported.NodeListgetElementsByTagName(String localName)NodeListgetElementsByTagNameNS(String namespaceURI, String name)NodegetFirstChild()intgetFirstChildIndex()DOMImplementationgetImplementation()Unsupported.StringgetInputEncoding()Unsupported.NodegetLastChild()protected NodegetNextChild(int child)StringgetNodeName()protected intgetNumChildren()DocumentgetOwnerDocument()OwnerDocument of namespace attribute is created artificially, which only contains the attribute only.protected NodegetPreviousChild(int node)booleangetStrictErrorChecking()Unsupported.StringgetXmlEncoding()Unsupported.booleangetXmlStandalone()Unsupported.StringgetXmlVersion()booleanhasChildNodes()NodeimportNode(Node arg0, boolean arg1)Unsupported.protected voidinitClonedOwnerDoc()booleanisDefaultNamespace(String namespaceURI)booleanisXMLDoc()Document can be an XML document or a text document.StringlookupNamespaceURI(String prefix)StringlookupPrefix(String namespaceURI)voidnormalizeDocument()Unsupported.NoderenameNode(Node arg0, String arg1, String arg2)Unsupported.voidsetDocumentURI(String arg0)Unsupported.voidsetStrictErrorChecking(boolean arg0)Unsupported.voidsetXmlStandalone(boolean arg0)Unsupported.voidsetXmlVersion(String arg0)Unsupported.-
Methods inherited from class com.marklogic.dom.NodeImpl
appendChild, builtinNSPrefix, cloneNode, compareDocumentPosition, getAttributes, getBaseURI, getElementsByTagNameNSOrNodeName, getExpandedTree, getFeature, getLocalName, getNamespaceURI, getNextSibling, getNodeType, getNodeValue, getNSNodeID, getNSNodeID, getParentNode, getPrefix, getPrefixID, getPreviousSibling, getTextContent, getUserData, hasAttributes, insertBefore, isEqualNode, isSameNode, isSupported, nextNSNodeID, normalize, removeChild, replaceChild, setNodeValue, setPrefix, setTextContent, setUserData
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.w3c.dom.Node
appendChild, compareDocumentPosition, getAttributes, getBaseURI, getFeature, getLocalName, getNamespaceURI, getNextSibling, getNodeType, getNodeValue, getParentNode, getPrefix, getPreviousSibling, getTextContent, getUserData, hasAttributes, insertBefore, isEqualNode, isSameNode, isSupported, normalize, removeChild, replaceChild, setNodeValue, setPrefix, setTextContent, setUserData
-
-
-
-
Constructor Detail
-
DocumentImpl
public DocumentImpl(ExpandedTree tree, int node)
-
-
Method Detail
-
cloneNode
public Node cloneNode(boolean deep)
CloneNode is only supported for document node.Text documents in MarkLogic cannot be cloned. UnsupportedOperationException will be thrown if cloneNode is call on text document. >
DocumentType node will not be cloned as it is not part of the Expanded Tree.>
-
initClonedOwnerDoc
protected void initClonedOwnerDoc() throws ParserConfigurationException- Throws:
ParserConfigurationException
-
isXMLDoc
public boolean isXMLDoc()
Document can be an XML document or a text document.- Returns:
- true if XML document; otherwise false.
-
getNodeName
public String getNodeName()
Description copied from class:NodeImpl- Specified by:
getNodeNamein interfaceNode- Specified by:
getNodeNamein classNodeImpl
-
getOwnerDocument
public Document getOwnerDocument()
Description copied from class:NodeImplOwnerDocument of namespace attribute is created artificially, which only contains the attribute only.- Specified by:
getOwnerDocumentin interfaceNode- Overrides:
getOwnerDocumentin classNodeImpl
-
getNumChildren
protected int getNumChildren()
-
getFirstChildIndex
public int getFirstChildIndex()
-
getChildNodes
public NodeList getChildNodes()
Description copied from class:NodeImpl- Specified by:
getChildNodesin interfaceNode- Overrides:
getChildNodesin classNodeImpl
-
getFirstChild
public Node getFirstChild()
Description copied from class:NodeImpl- Specified by:
getFirstChildin interfaceNode- Overrides:
getFirstChildin classNodeImpl
-
getLastChild
public Node getLastChild()
Description copied from class:NodeImpl- Specified by:
getLastChildin interfaceNode- Overrides:
getLastChildin classNodeImpl
-
hasChildNodes
public boolean hasChildNodes()
Description copied from class:NodeImpl- Specified by:
hasChildNodesin interfaceNode- Overrides:
hasChildNodesin classNodeImpl
-
getNextChild
protected Node getNextChild(int child)
- Overrides:
getNextChildin classNodeImpl
-
getPreviousChild
protected Node getPreviousChild(int node)
- Overrides:
getPreviousChildin classNodeImpl
-
adoptNode
public Node adoptNode(Node arg0) throws DOMException
Unsupported.- Specified by:
adoptNodein interfaceDocument- Throws:
DOMException
-
createAttribute
public Attr createAttribute(String arg0) throws DOMException
Unsupported.- Specified by:
createAttributein interfaceDocument- Throws:
DOMException
-
createAttributeNS
public Attr createAttributeNS(String arg0, String arg1) throws DOMException
Unsupported.- Specified by:
createAttributeNSin interfaceDocument- Throws:
DOMException
-
createCDATASection
public CDATASection createCDATASection(String arg0) throws DOMException
Unsupported.- Specified by:
createCDATASectionin interfaceDocument- Throws:
DOMException
-
createComment
public Comment createComment(String arg0)
Unsupported.- Specified by:
createCommentin interfaceDocument
-
createDocumentFragment
public DocumentFragment createDocumentFragment()
Unsupported.- Specified by:
createDocumentFragmentin interfaceDocument
-
createElement
public Element createElement(String arg0) throws DOMException
Unsupported.- Specified by:
createElementin interfaceDocument- Throws:
DOMException
-
createElementNS
public Element createElementNS(String arg0, String arg1) throws DOMException
Unsupported.- Specified by:
createElementNSin interfaceDocument- Throws:
DOMException
-
createEntityReference
public EntityReference createEntityReference(String arg0) throws DOMException
Unsupported.- Specified by:
createEntityReferencein interfaceDocument- Throws:
DOMException
-
createProcessingInstruction
public ProcessingInstruction createProcessingInstruction(String arg0, String arg1) throws DOMException
Unsupported.- Specified by:
createProcessingInstructionin interfaceDocument- Throws:
DOMException
-
createTextNode
public Text createTextNode(String arg0)
Unsupported.- Specified by:
createTextNodein interfaceDocument
-
getDoctype
public DocumentType getDoctype()
Returns a dummy DocumentTypeImpl object that contains nothing. It is not expected to do anything with the returned object.- Specified by:
getDoctypein interfaceDocument
-
getDocumentElement
public Element getDocumentElement()
- Specified by:
getDocumentElementin interfaceDocument
-
isDefaultNamespace
public boolean isDefaultNamespace(String namespaceURI)
Description copied from class:NodeImplNot supported for namespace declaration. Overrided by DocumentImpl and ElementImpl
- Specified by:
isDefaultNamespacein interfaceNode- Overrides:
isDefaultNamespacein classNodeImpl
-
getDocumentURI
public String getDocumentURI()
- Specified by:
getDocumentURIin interfaceDocument
-
getDomConfig
public DOMConfiguration getDomConfig()
Unsupported.- Specified by:
getDomConfigin interfaceDocument
-
getElementById
public Element getElementById(String arg0)
Unsupported.- Specified by:
getElementByIdin interfaceDocument
-
getElementsByTagNameNS
public NodeList getElementsByTagNameNS(String namespaceURI, String name)
- Specified by:
getElementsByTagNameNSin interfaceDocument
-
getElementsByTagName
public NodeList getElementsByTagName(String localName)
- Specified by:
getElementsByTagNamein interfaceDocument
-
getImplementation
public DOMImplementation getImplementation()
Unsupported.- Specified by:
getImplementationin interfaceDocument
-
getInputEncoding
public String getInputEncoding()
Unsupported.- Specified by:
getInputEncodingin interfaceDocument
-
getStrictErrorChecking
public boolean getStrictErrorChecking()
Unsupported.- Specified by:
getStrictErrorCheckingin interfaceDocument
-
getXmlEncoding
public String getXmlEncoding()
Unsupported.- Specified by:
getXmlEncodingin interfaceDocument
-
getXmlStandalone
public boolean getXmlStandalone()
Unsupported.- Specified by:
getXmlStandalonein interfaceDocument
-
getXmlVersion
public String getXmlVersion()
- Specified by:
getXmlVersionin interfaceDocument
-
importNode
public Node importNode(Node arg0, boolean arg1) throws DOMException
Unsupported.- Specified by:
importNodein interfaceDocument- Throws:
DOMException
-
lookupNamespaceURI
public String lookupNamespaceURI(String prefix)
Description copied from class:NodeImpl- Specified by:
lookupNamespaceURIin interfaceNode- Overrides:
lookupNamespaceURIin classNodeImpl
-
lookupPrefix
public String lookupPrefix(String namespaceURI)
Description copied from class:NodeImpl- Specified by:
lookupPrefixin interfaceNode- Overrides:
lookupPrefixin classNodeImpl
-
normalizeDocument
public void normalizeDocument()
Unsupported.- Specified by:
normalizeDocumentin interfaceDocument
-
renameNode
public Node renameNode(Node arg0, String arg1, String arg2) throws DOMException
Unsupported.- Specified by:
renameNodein interfaceDocument- Throws:
DOMException
-
setDocumentURI
public void setDocumentURI(String arg0)
Unsupported.- Specified by:
setDocumentURIin interfaceDocument
-
setStrictErrorChecking
public void setStrictErrorChecking(boolean arg0)
Unsupported.- Specified by:
setStrictErrorCheckingin interfaceDocument
-
setXmlStandalone
public void setXmlStandalone(boolean arg0) throws DOMExceptionUnsupported.- Specified by:
setXmlStandalonein interfaceDocument- Throws:
DOMException
-
setXmlVersion
public void setXmlVersion(String arg0) throws DOMException
Unsupported.- Specified by:
setXmlVersionin interfaceDocument- Throws:
DOMException
-
-