Package uk.ac.starlink.votable.dom
Class DelegatingDocument
java.lang.Object
uk.ac.starlink.votable.dom.DelegatingNode
uk.ac.starlink.votable.dom.DelegatingDocument
- Direct Known Subclasses:
VODocument
DOM Document implementation which delegates its operations to a
base Document instance. This is the basic class which must be
used and extended when using the delegate DOM package.
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.
- Since:
- 14 Sep 2004
- Author:
- Mark Taylor (Starlink)
-
Field Summary
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
ConstructorsConstructorDescriptionDelegatingDocument(String documentURI) Constructs a new empty document based on a new empty document got from the default DOM implementation.DelegatingDocument(Document base, String documentURI) Constructs a new document which delegates its behaviour to a Document from another DOM. -
Method Summary
Modifier and TypeMethodDescriptioncreateAttribute(String name) createAttributeNS(String namespaceURI, String qualifiedName) createCDATASection(String data) createComment(String data) protected DelegatingAttrcreateDelegatingAttr(Attr baseNode) Creates a new node in this document that delegates to an object of classAttrin the base model.protected DelegatingAttrcreateDelegatingAttr(Attr baseNode, boolean isId) Creates a new node in this document that delegates to an object of classAttrand knows whether it is an ID-type attribute or not.protected DelegatingCDATASectioncreateDelegatingCDATASection(CDATASection baseNode) Creates a new node in this document that delegates to an object of classCDATASectionin the base model.protected DelegatingCharacterDatacreateDelegatingCharacterData(CharacterData baseNode) Creates a new node in this document that delegates to an object of classCharacterData(not one of its subclasses) in the base model.protected DelegatingCommentcreateDelegatingComment(Comment baseNode) Creates a new node in this document that delegates to an object of classCommentin the base model.protected DelegatingDocumentFragmentCreates a new node in this document that delegates to an object of classDocumentFragmentin the base model.protected DelegatingDocumentTypecreateDelegatingDocumentType(DocumentType baseNode) Creates a new node in this document that delegates to an object of classDocumentTypein the base model.protected DelegatingElementcreateDelegatingElement(Element baseNode) Creates a new node in this document that delegates to an object of classElementin the base model.protected DelegatingEntitycreateDelegatingEntity(Entity baseNode) Creates a new node in this document that delegates to an object of classEntityin the base model.protected DelegatingEntityReferenceCreates a new node in this document that delegates to an object of classEntityReferencein the base model.protected NamedNodeMapcreateDelegatingNamedNodeMap(NamedNodeMap baseMap) Returns a NamedNodeMap which will dispense nodes in this document.protected NodeListcreateDelegatingNodeList(NodeList baseList) Returns a NodeList which will dispense nodes in this document.protected DelegatingNotationcreateDelegatingNotation(Notation baseNode) Creates a new node in this document that delegates to an object of classNotationin the base model.protected DelegatingProcessingInstructionCreates a new node in this document that delegates to an object of classProcessingInstructionin the base model.protected DelegatingNodecreateDelegatingSimpleNode(Node baseNode) Creates a new node in this document that delegates to an object of classNode(not one of its subclasses) in the base model.protected DelegatingTextcreateDelegatingText(Text baseNode) Creates a new node in this document that delegates to an object of classText(not one of its subclasses) in the base model.createElement(String tagName) createElementNS(String namespaceURI, String qualifiedName) createEntityReference(String name) createProcessingInstruction(String target, String data) createTextNode(String data) protected DocumentReturns the base document (the one to which this delegates).protected DelegatingNodegetDelegator(Node baseNode) Returns the node in this document which delegates to (is based on) a given node in the base document.getElementById(String elementId) getElementsByTagName(String tagname) getElementsByTagNameNS(String namespaceURI, String localName) Returns the implementation of the base document.booleanbooleanimportNode(Node importedNode, boolean deep) voidrenameNode(Node node, String namespaceURI, String qualifiedName) voidsetDocumentURI(String documentURI) voidsetStrictErrorChecking(boolean strictErrorChecking) voidsetXmlStandalone(boolean xmlStandalone) voidsetXmlVersion(String xmlVersion) Methods inherited from class uk.ac.starlink.votable.dom.DelegatingNode
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, setUserDataMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.w3c.dom.Node
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, setUserData
-
Constructor Details
-
DelegatingDocument
Constructs a new document which delegates its behaviour to a Document from another DOM.- Parameters:
base- delegate document nodedocumentURI- location of the document, or null
-
DelegatingDocument
Constructs a new empty document based on a new empty document got from the default DOM implementation. This can theoretically result in a ParserConfigurationException, but shouldn't do for any sensibly set up JVM - any such condition is rethrown as a RuntimeException.- Parameters:
documentURI- location of the document, or null
-
-
Method Details
-
getDelegator
Returns the node in this document which delegates to (is based on) a given node in the base document. If this node has not previously been encountered, it will be created here.- Parameters:
baseNode- node in the base document- Returns:
- corresponding node in this document
-
getBaseDocument
Returns the base document (the one to which this delegates).- Returns:
- base document
-
createDelegatingSimpleNode
Creates a new node in this document that delegates to an object of classNode(not one of its subclasses) in the base model. This may be overridden to create specialised node types.- Parameters:
baseNode- delegate node- Returns:
- new node in this model based on baseNode
-
createDelegatingAttr
Creates a new node in this document that delegates to an object of classAttrin the base model. This may be overridden to create specialised node types.- Parameters:
baseNode- delegate node- Returns:
- new node in this model based on baseNode
-
createDelegatingAttr
Creates a new node in this document that delegates to an object of classAttrand 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 ofcreateDelegatingAttr(org.w3c.dom.Attr).- Parameters:
baseNode- delegate nodeisId- true if this node knows it is an ID, false if it knows it isn't- Returns:
- new node in this model based on baseNode
-
createDelegatingCDATASection
Creates a new node in this document that delegates to an object of classCDATASectionin the base model. This may be overridden to create specialised node types.- Parameters:
baseNode- delegate node- Returns:
- new node in this model based on baseNode
-
createDelegatingCharacterData
Creates a new node in this document that delegates to an object of classCharacterData(not one of its subclasses) in the base model. This may be overridden to create specialised node types.- Parameters:
baseNode- delegate node- Returns:
- new node in this model based on baseNode
-
createDelegatingComment
Creates a new node in this document that delegates to an object of classCommentin the base model. This may be overridden to create specialised node types.- Parameters:
baseNode- delegate node- Returns:
- new node in this model based on baseNode
-
createDelegatingDocumentFragment
Creates a new node in this document that delegates to an object of classDocumentFragmentin the base model. This may be overridden to create specialised node types.- Parameters:
baseNode- delegate node- Returns:
- new node in this model based on baseNode
-
createDelegatingDocumentType
Creates a new node in this document that delegates to an object of classDocumentTypein the base model. This may be overridden to create specialised node types.- Parameters:
baseNode- delegate node- Returns:
- new node in this model based on baseNode
-
createDelegatingElement
Creates a new node in this document that delegates to an object of classElementin the base model. This may be overridden to create specialised node types.- Parameters:
baseNode- delegate node- Returns:
- new node in this model based on baseNode
-
createDelegatingEntity
Creates a new node in this document that delegates to an object of classEntityin the base model. This may be overridden to create specialised node types.- Parameters:
baseNode- delegate node- Returns:
- new node in this model based on baseNode
-
createDelegatingEntityReference
Creates a new node in this document that delegates to an object of classEntityReferencein the base model. This may be overridden to create specialised node types.- Parameters:
baseNode- delegate node- Returns:
- new node in this model based on baseNode
-
createDelegatingNotation
Creates a new node in this document that delegates to an object of classNotationin the base model. This may be overridden to create specialised node types.- Parameters:
baseNode- delegate node- Returns:
- new node in this model based on baseNode
-
createDelegatingProcessingInstruction
protected DelegatingProcessingInstruction createDelegatingProcessingInstruction(ProcessingInstruction baseNode) Creates a new node in this document that delegates to an object of classProcessingInstructionin the base model. This may be overridden to create specialised node types.- Parameters:
baseNode- delegate node- Returns:
- new node in this model based on baseNode
-
createDelegatingText
Creates a new node in this document that delegates to an object of classText(not one of its subclasses) in the base model. This may be overridden to create specialised node types.- Parameters:
baseNode- delegate node- Returns:
- new node in this model based on baseNode
-
createDelegatingNodeList
Returns a NodeList which will dispense nodes in this document.- Parameters:
baseList- node list which dispenses nodes in the base document- Returns:
- equivalent of baseList in this document
-
createDelegatingNamedNodeMap
Returns a NamedNodeMap which will dispense nodes in this document.- Parameters:
baseMap- node map which dispenses nodes in the base document- Returns:
- equivalent of baseMap in this document
-
getImplementation
Returns the implementation of the base document.- Specified by:
getImplementationin interfaceDocument
-
getDoctype
- Specified by:
getDoctypein interfaceDocument
-
getDocumentElement
- Specified by:
getDocumentElementin interfaceDocument
-
createElement
- Specified by:
createElementin interfaceDocument
-
createDocumentFragment
- Specified by:
createDocumentFragmentin interfaceDocument
-
createTextNode
- Specified by:
createTextNodein interfaceDocument
-
createComment
- Specified by:
createCommentin interfaceDocument
-
createCDATASection
- Specified by:
createCDATASectionin interfaceDocument
-
createProcessingInstruction
- Specified by:
createProcessingInstructionin interfaceDocument
-
createAttribute
- Specified by:
createAttributein interfaceDocument
-
createEntityReference
- Specified by:
createEntityReferencein interfaceDocument
-
getElementsByTagName
- Specified by:
getElementsByTagNamein interfaceDocument
-
importNode
- Specified by:
importNodein interfaceDocument
-
createElementNS
- Specified by:
createElementNSin interfaceDocument
-
createAttributeNS
- Specified by:
createAttributeNSin interfaceDocument
-
getElementsByTagNameNS
- Specified by:
getElementsByTagNameNSin interfaceDocument
-
getElementById
- Specified by:
getElementByIdin interfaceDocument
-
getInputEncoding
- Specified by:
getInputEncodingin interfaceDocument
-
getXmlEncoding
- Specified by:
getXmlEncodingin interfaceDocument
-
getXmlStandalone
public boolean getXmlStandalone()- Specified by:
getXmlStandalonein interfaceDocument
-
setXmlStandalone
public void setXmlStandalone(boolean xmlStandalone) - Specified by:
setXmlStandalonein interfaceDocument
-
getXmlVersion
- Specified by:
getXmlVersionin interfaceDocument
-
setXmlVersion
- Specified by:
setXmlVersionin interfaceDocument
-
getStrictErrorChecking
public boolean getStrictErrorChecking()- Specified by:
getStrictErrorCheckingin interfaceDocument
-
setStrictErrorChecking
public void setStrictErrorChecking(boolean strictErrorChecking) - Specified by:
setStrictErrorCheckingin interfaceDocument
-
getDocumentURI
- Specified by:
getDocumentURIin interfaceDocument
-
setDocumentURI
- Specified by:
setDocumentURIin interfaceDocument
-
adoptNode
-
getDomConfig
- Specified by:
getDomConfigin interfaceDocument
-
normalizeDocument
public void normalizeDocument()- Specified by:
normalizeDocumentin interfaceDocument
-
renameNode
- Specified by:
renameNodein interfaceDocument
-