public class DelegatingDocument extends DelegatingNode implements Document
In order to specialise the nodes which appear in a DOM,
you have to override the protected createDelegating*
methods to return your own custom DelegatingNode subclasses.
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 and Description |
|---|
DelegatingDocument(Document base,
String documentURI)
Constructs a new document which delegates its behaviour to a
Document from another DOM. |
DelegatingDocument(String documentURI)
Constructs a new empty document based on a new empty document
got from the default DOM implementation.
|
| Modifier and Type | Method and Description |
|---|---|
Node |
adoptNode(Node source) |
Attr |
createAttribute(String name) |
Attr |
createAttributeNS(String namespaceURI,
String qualifiedName) |
CDATASection |
createCDATASection(String data) |
Comment |
createComment(String data) |
protected DelegatingAttr |
createDelegatingAttr(Attr baseNode)
Creates a new node in this document that delegates to an object
of class
Attr
in the base model. |
protected DelegatingAttr |
createDelegatingAttr(Attr baseNode,
boolean isId)
Creates a new node in this document that delegates to an object
of class
Attr and knows whether it is an
ID-type attribute or not. |
protected DelegatingCDATASection |
createDelegatingCDATASection(CDATASection baseNode)
Creates a new node in this document that delegates to an object
of class
CDATASection
in the base model. |
protected DelegatingCharacterData |
createDelegatingCharacterData(CharacterData baseNode)
Creates a new node in this document that delegates to an object
of class
CharacterData (not one of its subclasses)
in the base model. |
protected DelegatingComment |
createDelegatingComment(Comment baseNode)
Creates a new node in this document that delegates to an object
of class
Comment
in the base model. |
protected DelegatingDocumentFragment |
createDelegatingDocumentFragment(DocumentFragment baseNode)
Creates a new node in this document that delegates to an object
of class
DocumentFragment
in the base model. |
protected DelegatingDocumentType |
createDelegatingDocumentType(DocumentType baseNode)
Creates a new node in this document that delegates to an object
of class
DocumentType
in the base model. |
protected DelegatingElement |
createDelegatingElement(Element baseNode)
Creates a new node in this document that delegates to an object
of class
Element
in the base model. |
protected DelegatingEntity |
createDelegatingEntity(Entity baseNode)
Creates a new node in this document that delegates to an object
of class
Entity
in the base model. |
protected DelegatingEntityReference |
createDelegatingEntityReference(EntityReference baseNode)
Creates a new node in this document that delegates to an object
of class
EntityReference
in the base model. |
protected NamedNodeMap |
createDelegatingNamedNodeMap(NamedNodeMap baseMap)
Returns a NamedNodeMap which will dispense nodes in this document.
|
protected NodeList |
createDelegatingNodeList(NodeList baseList)
Returns a NodeList which will dispense nodes in this document.
|
protected DelegatingNotation |
createDelegatingNotation(Notation baseNode)
Creates a new node in this document that delegates to an object
of class
Notation
in the base model. |
protected DelegatingProcessingInstruction |
createDelegatingProcessingInstruction(ProcessingInstruction baseNode)
Creates a new node in this document that delegates to an object
of class
ProcessingInstruction
in the base model. |
protected DelegatingNode |
createDelegatingSimpleNode(Node baseNode)
Creates a new node in this document that delegates to an object
of class
Node (not one of its subclasses)
in the base model. |
protected DelegatingText |
createDelegatingText(Text baseNode)
Creates a new node in this document that delegates to an object
of class
Text (not one of its subclasses)
in the base model. |
DocumentFragment |
createDocumentFragment() |
Element |
createElement(String tagName) |
Element |
createElementNS(String namespaceURI,
String qualifiedName) |
EntityReference |
createEntityReference(String name) |
ProcessingInstruction |
createProcessingInstruction(String target,
String data) |
Text |
createTextNode(String data) |
protected Document |
getBaseDocument()
Returns the base document (the one to which this delegates).
|
protected DelegatingNode |
getDelegator(Node baseNode)
Returns the node in this document which delegates to (is based on)
a given node in the base document.
|
DocumentType |
getDoctype() |
Element |
getDocumentElement() |
String |
getDocumentURI() |
DOMConfiguration |
getDomConfig() |
Element |
getElementById(String elementId) |
NodeList |
getElementsByTagName(String tagname) |
NodeList |
getElementsByTagNameNS(String namespaceURI,
String localName) |
DOMImplementation |
getImplementation()
Returns the implementation of the base document.
|
String |
getInputEncoding() |
boolean |
getStrictErrorChecking() |
String |
getXmlEncoding() |
boolean |
getXmlStandalone() |
String |
getXmlVersion() |
Node |
importNode(Node importedNode,
boolean deep) |
void |
normalizeDocument() |
Node |
renameNode(Node node,
String namespaceURI,
String qualifiedName) |
void |
setDocumentURI(String documentURI) |
void |
setStrictErrorChecking(boolean strictErrorChecking) |
void |
setXmlStandalone(boolean xmlStandalone) |
void |
setXmlVersion(String xmlVersion) |
appendChild, cloneNode, compareDocumentPosition, getAttributes, getBaseURI, getChildNodes, getFeature, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, getTextContent, getUserData, hasAttributes, hasChildNodes, insertBefore, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, removeChild, replaceChild, setNodeValue, setPrefix, setTextContent, setUserDataclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitappendChild, cloneNode, compareDocumentPosition, getAttributes, getBaseURI, getChildNodes, getFeature, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, getTextContent, getUserData, hasAttributes, hasChildNodes, insertBefore, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, removeChild, replaceChild, setNodeValue, setPrefix, setTextContent, setUserDatapublic DelegatingDocument(Document base, String documentURI)
Document from another DOM.base - delegate document nodedocumentURI - location of the document, or nullpublic DelegatingDocument(String documentURI)
documentURI - location of the document, or nullprotected DelegatingNode getDelegator(Node baseNode)
baseNode - node in the base documentprotected Document getBaseDocument()
protected DelegatingNode createDelegatingSimpleNode(Node baseNode)
Node (not one of its subclasses)
in the base model. This may be overridden to create specialised
node types.baseNode - delegate nodebaseNodeprotected DelegatingAttr createDelegatingAttr(Attr baseNode)
Attr
in the base model. This may be overridden to create specialised
node types.baseNode - delegate nodebaseNodeprotected DelegatingAttr createDelegatingAttr(Attr baseNode, boolean isId)
Attr and knows whether it is an
ID-type attribute or not. This is not called by any method of
this class, but can be used by subclass implementations of
createDelegatingAttr(org.w3c.dom.Attr).baseNode - delegate nodeisId - true if this node knows it is an ID, false if it knows
it isn'tbaseNodeprotected DelegatingCDATASection createDelegatingCDATASection(CDATASection baseNode)
CDATASection
in the base model. This may be overridden to create specialised
node types.baseNode - delegate nodebaseNodeprotected DelegatingCharacterData createDelegatingCharacterData(CharacterData baseNode)
CharacterData (not one of its subclasses)
in the base model. This may be overridden to create specialised
node types.baseNode - delegate nodebaseNodeprotected DelegatingComment createDelegatingComment(Comment baseNode)
Comment
in the base model. This may be overridden to create specialised
node types.baseNode - delegate nodebaseNodeprotected DelegatingDocumentFragment createDelegatingDocumentFragment(DocumentFragment baseNode)
DocumentFragment
in the base model. This may be overridden to create specialised
node types.baseNode - delegate nodebaseNodeprotected DelegatingDocumentType createDelegatingDocumentType(DocumentType baseNode)
DocumentType
in the base model. This may be overridden to create specialised
node types.baseNode - delegate nodebaseNodeprotected DelegatingElement createDelegatingElement(Element baseNode)
Element
in the base model. This may be overridden to create specialised
node types.baseNode - delegate nodebaseNodeprotected DelegatingEntity createDelegatingEntity(Entity baseNode)
Entity
in the base model. This may be overridden to create specialised
node types.baseNode - delegate nodebaseNodeprotected DelegatingEntityReference createDelegatingEntityReference(EntityReference baseNode)
EntityReference
in the base model. This may be overridden to create specialised
node types.baseNode - delegate nodebaseNodeprotected DelegatingNotation createDelegatingNotation(Notation baseNode)
Notation
in the base model. This may be overridden to create specialised
node types.baseNode - delegate nodebaseNodeprotected DelegatingProcessingInstruction createDelegatingProcessingInstruction(ProcessingInstruction baseNode)
ProcessingInstruction
in the base model. This may be overridden to create specialised
node types.baseNode - delegate nodebaseNodeprotected DelegatingText createDelegatingText(Text baseNode)
Text (not one of its subclasses)
in the base model. This may be overridden to create specialised
node types.baseNode - delegate nodebaseNodeprotected NodeList createDelegatingNodeList(NodeList baseList)
baseList - node list which dispenses nodes in the base documentbaseList in this documentprotected NamedNodeMap createDelegatingNamedNodeMap(NamedNodeMap baseMap)
baseMap - node map which dispenses nodes in the base documentbaseMap in this documentpublic DOMImplementation getImplementation()
getImplementation in interface Documentpublic DocumentType getDoctype()
getDoctype in interface Documentpublic Element getDocumentElement()
getDocumentElement in interface Documentpublic Element createElement(String tagName)
createElement in interface Documentpublic DocumentFragment createDocumentFragment()
createDocumentFragment in interface Documentpublic Text createTextNode(String data)
createTextNode in interface Documentpublic Comment createComment(String data)
createComment in interface Documentpublic CDATASection createCDATASection(String data)
createCDATASection in interface Documentpublic ProcessingInstruction createProcessingInstruction(String target, String data)
createProcessingInstruction in interface Documentpublic Attr createAttribute(String name)
createAttribute in interface Documentpublic EntityReference createEntityReference(String name)
createEntityReference in interface Documentpublic NodeList getElementsByTagName(String tagname)
getElementsByTagName in interface Documentpublic Node importNode(Node importedNode, boolean deep)
importNode in interface Documentpublic Element createElementNS(String namespaceURI, String qualifiedName)
createElementNS in interface Documentpublic Attr createAttributeNS(String namespaceURI, String qualifiedName)
createAttributeNS in interface Documentpublic NodeList getElementsByTagNameNS(String namespaceURI, String localName)
getElementsByTagNameNS in interface Documentpublic Element getElementById(String elementId)
getElementById in interface Documentpublic String getInputEncoding()
getInputEncoding in interface Documentpublic String getXmlEncoding()
getXmlEncoding in interface Documentpublic boolean getXmlStandalone()
getXmlStandalone in interface Documentpublic void setXmlStandalone(boolean xmlStandalone)
setXmlStandalone in interface Documentpublic String getXmlVersion()
getXmlVersion in interface Documentpublic void setXmlVersion(String xmlVersion)
setXmlVersion in interface Documentpublic boolean getStrictErrorChecking()
getStrictErrorChecking in interface Documentpublic void setStrictErrorChecking(boolean strictErrorChecking)
setStrictErrorChecking in interface Documentpublic String getDocumentURI()
getDocumentURI in interface Documentpublic void setDocumentURI(String documentURI)
setDocumentURI in interface Documentpublic DOMConfiguration getDomConfig()
getDomConfig in interface Documentpublic void normalizeDocument()
normalizeDocument in interface DocumentCopyright © 2025 Central Laboratory of the Research Councils. All Rights Reserved.