adapforms.runtime.state.dom
Class AbstractDocument

java.lang.Object
  extended by adapforms.runtime.state.dom.AbstractNode
      extended by adapforms.runtime.state.dom.AbstractDocument
All Implemented Interfaces:
org.w3c.dom.Document, org.w3c.dom.Node
Direct Known Subclasses:
StateTree.DOMStateDocument

public abstract class AbstractDocument
extends AbstractNode
implements org.w3c.dom.Document

Abstract class for creating simple DOM Document instances, allowing subclasses to overwrite only those methods they need.

Most methods simply throw an UnsupportedOperationException when invoked. Others implement the dictated behavior (e.g. node type, parent node etc.). There methods are marked as being final.

Author:
Henrik Gammelmark, geemark@cs.au.dk

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
AbstractDocument()
           
 
Method Summary
 org.w3c.dom.Node adoptNode(org.w3c.dom.Node source)
           
 org.w3c.dom.Attr createAttribute(java.lang.String name)
           
 org.w3c.dom.Attr createAttributeNS(java.lang.String namespaceURI, java.lang.String qualifiedName)
           
 org.w3c.dom.CDATASection createCDATASection(java.lang.String data)
           
 org.w3c.dom.Comment createComment(java.lang.String data)
           
 org.w3c.dom.DocumentFragment createDocumentFragment()
           
 org.w3c.dom.Element createElement(java.lang.String tagName)
           
 org.w3c.dom.Element createElementNS(java.lang.String namespaceURI, java.lang.String qualifiedName)
           
 org.w3c.dom.EntityReference createEntityReference(java.lang.String name)
           
 org.w3c.dom.ProcessingInstruction createProcessingInstruction(java.lang.String target, java.lang.String data)
           
 org.w3c.dom.Text createTextNode(java.lang.String data)
           
 org.w3c.dom.DocumentType getDoctype()
           
 org.w3c.dom.Element getDocumentElement()
           
 java.lang.String getDocumentURI()
           
 org.w3c.dom.DOMConfiguration getDomConfig()
           
 org.w3c.dom.Element getElementById(java.lang.String elementId)
           
 org.w3c.dom.NodeList getElementsByTagName(java.lang.String tagname)
           
 org.w3c.dom.NodeList getElementsByTagNameNS(java.lang.String namespaceURI, java.lang.String localName)
           
 org.w3c.dom.DOMImplementation getImplementation()
           
 java.lang.String getInputEncoding()
           
 short getNodeType()
           
 java.lang.String getNodeValue()
           
 org.w3c.dom.Document getOwnerDocument()
           
 org.w3c.dom.Node getParentNode()
           
 boolean getStrictErrorChecking()
           
 java.lang.String getTextContent()
           
 java.lang.String getXmlEncoding()
           
 boolean getXmlStandalone()
           
 java.lang.String getXmlVersion()
           
 boolean hasAttributes()
           
 org.w3c.dom.Node importNode(org.w3c.dom.Node importedNode, boolean deep)
           
 void normalizeDocument()
           
 org.w3c.dom.Node renameNode(org.w3c.dom.Node n, java.lang.String namespaceURI, java.lang.String qualifiedName)
           
 void setDocumentURI(java.lang.String documentURI)
           
 void setStrictErrorChecking(boolean strictErrorChecking)
           
 void setTextContent(java.lang.String textContent)
           
 void setXmlStandalone(boolean xmlStandalone)
           
 void setXmlVersion(java.lang.String xmlVersion)
           
 
Methods inherited from class adapforms.runtime.state.dom.AbstractNode
appendChild, cloneNode, compareDocumentPosition, getAttributes, getBaseURI, getChildNodes, getFeature, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getPrefix, getPreviousSibling, getUserData, hasChildNodes, insertBefore, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, removeChild, replaceChild, setNodeValue, setPrefix, 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, cloneNode, compareDocumentPosition, getAttributes, getBaseURI, getChildNodes, getFeature, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getPrefix, getPreviousSibling, getUserData, hasChildNodes, insertBefore, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, removeChild, replaceChild, setNodeValue, setPrefix, setUserData
 

Constructor Detail

AbstractDocument

public AbstractDocument()
Method Detail

adoptNode

public org.w3c.dom.Node adoptNode(org.w3c.dom.Node source)
                           throws org.w3c.dom.DOMException
Specified by:
adoptNode in interface org.w3c.dom.Document
Throws:
org.w3c.dom.DOMException

createAttribute

public org.w3c.dom.Attr createAttribute(java.lang.String name)
                                 throws org.w3c.dom.DOMException
Specified by:
createAttribute in interface org.w3c.dom.Document
Throws:
org.w3c.dom.DOMException

createAttributeNS

public org.w3c.dom.Attr createAttributeNS(java.lang.String namespaceURI,
                                          java.lang.String qualifiedName)
                                   throws org.w3c.dom.DOMException
Specified by:
createAttributeNS in interface org.w3c.dom.Document
Throws:
org.w3c.dom.DOMException

createCDATASection

public org.w3c.dom.CDATASection createCDATASection(java.lang.String data)
                                            throws org.w3c.dom.DOMException
Specified by:
createCDATASection in interface org.w3c.dom.Document
Throws:
org.w3c.dom.DOMException

createComment

public org.w3c.dom.Comment createComment(java.lang.String data)
Specified by:
createComment in interface org.w3c.dom.Document

createDocumentFragment

public org.w3c.dom.DocumentFragment createDocumentFragment()
Specified by:
createDocumentFragment in interface org.w3c.dom.Document

createElement

public org.w3c.dom.Element createElement(java.lang.String tagName)
                                  throws org.w3c.dom.DOMException
Specified by:
createElement in interface org.w3c.dom.Document
Throws:
org.w3c.dom.DOMException

createElementNS

public org.w3c.dom.Element createElementNS(java.lang.String namespaceURI,
                                           java.lang.String qualifiedName)
                                    throws org.w3c.dom.DOMException
Specified by:
createElementNS in interface org.w3c.dom.Document
Throws:
org.w3c.dom.DOMException

createEntityReference

public org.w3c.dom.EntityReference createEntityReference(java.lang.String name)
                                                  throws org.w3c.dom.DOMException
Specified by:
createEntityReference in interface org.w3c.dom.Document
Throws:
org.w3c.dom.DOMException

createProcessingInstruction

public org.w3c.dom.ProcessingInstruction createProcessingInstruction(java.lang.String target,
                                                                     java.lang.String data)
                                                              throws org.w3c.dom.DOMException
Specified by:
createProcessingInstruction in interface org.w3c.dom.Document
Throws:
org.w3c.dom.DOMException

createTextNode

public org.w3c.dom.Text createTextNode(java.lang.String data)
Specified by:
createTextNode in interface org.w3c.dom.Document

getDoctype

public org.w3c.dom.DocumentType getDoctype()
Specified by:
getDoctype in interface org.w3c.dom.Document

getDocumentElement

public org.w3c.dom.Element getDocumentElement()
Specified by:
getDocumentElement in interface org.w3c.dom.Document

getDocumentURI

public java.lang.String getDocumentURI()
Specified by:
getDocumentURI in interface org.w3c.dom.Document

getDomConfig

public org.w3c.dom.DOMConfiguration getDomConfig()
Specified by:
getDomConfig in interface org.w3c.dom.Document

getElementById

public org.w3c.dom.Element getElementById(java.lang.String elementId)
Specified by:
getElementById in interface org.w3c.dom.Document

getElementsByTagName

public org.w3c.dom.NodeList getElementsByTagName(java.lang.String tagname)
Specified by:
getElementsByTagName in interface org.w3c.dom.Document

getElementsByTagNameNS

public org.w3c.dom.NodeList getElementsByTagNameNS(java.lang.String namespaceURI,
                                                   java.lang.String localName)
Specified by:
getElementsByTagNameNS in interface org.w3c.dom.Document

getImplementation

public org.w3c.dom.DOMImplementation getImplementation()
Specified by:
getImplementation in interface org.w3c.dom.Document

getInputEncoding

public java.lang.String getInputEncoding()
Specified by:
getInputEncoding in interface org.w3c.dom.Document

getStrictErrorChecking

public boolean getStrictErrorChecking()
Specified by:
getStrictErrorChecking in interface org.w3c.dom.Document

getXmlEncoding

public java.lang.String getXmlEncoding()
Specified by:
getXmlEncoding in interface org.w3c.dom.Document

getXmlStandalone

public boolean getXmlStandalone()
Specified by:
getXmlStandalone in interface org.w3c.dom.Document

getXmlVersion

public java.lang.String getXmlVersion()
Specified by:
getXmlVersion in interface org.w3c.dom.Document

importNode

public org.w3c.dom.Node importNode(org.w3c.dom.Node importedNode,
                                   boolean deep)
                            throws org.w3c.dom.DOMException
Specified by:
importNode in interface org.w3c.dom.Document
Throws:
org.w3c.dom.DOMException

normalizeDocument

public void normalizeDocument()
Specified by:
normalizeDocument in interface org.w3c.dom.Document

renameNode

public org.w3c.dom.Node renameNode(org.w3c.dom.Node n,
                                   java.lang.String namespaceURI,
                                   java.lang.String qualifiedName)
                            throws org.w3c.dom.DOMException
Specified by:
renameNode in interface org.w3c.dom.Document
Throws:
org.w3c.dom.DOMException

setDocumentURI

public void setDocumentURI(java.lang.String documentURI)
Specified by:
setDocumentURI in interface org.w3c.dom.Document

setStrictErrorChecking

public void setStrictErrorChecking(boolean strictErrorChecking)
Specified by:
setStrictErrorChecking in interface org.w3c.dom.Document

setXmlStandalone

public void setXmlStandalone(boolean xmlStandalone)
                      throws org.w3c.dom.DOMException
Specified by:
setXmlStandalone in interface org.w3c.dom.Document
Throws:
org.w3c.dom.DOMException

setXmlVersion

public void setXmlVersion(java.lang.String xmlVersion)
                   throws org.w3c.dom.DOMException
Specified by:
setXmlVersion in interface org.w3c.dom.Document
Throws:
org.w3c.dom.DOMException

getNodeType

public final short getNodeType()
Specified by:
getNodeType in interface org.w3c.dom.Node
Specified by:
getNodeType in class AbstractNode

getNodeValue

public final java.lang.String getNodeValue()
                                    throws org.w3c.dom.DOMException
Specified by:
getNodeValue in interface org.w3c.dom.Node
Overrides:
getNodeValue in class AbstractNode
Throws:
org.w3c.dom.DOMException

getOwnerDocument

public final org.w3c.dom.Document getOwnerDocument()
Specified by:
getOwnerDocument in interface org.w3c.dom.Node
Overrides:
getOwnerDocument in class AbstractNode

getParentNode

public final org.w3c.dom.Node getParentNode()
Specified by:
getParentNode in interface org.w3c.dom.Node
Overrides:
getParentNode in class AbstractNode

hasAttributes

public final boolean hasAttributes()
Specified by:
hasAttributes in interface org.w3c.dom.Node
Overrides:
hasAttributes in class AbstractNode

getTextContent

public final java.lang.String getTextContent()
                                      throws org.w3c.dom.DOMException
Specified by:
getTextContent in interface org.w3c.dom.Node
Overrides:
getTextContent in class AbstractNode
Throws:
org.w3c.dom.DOMException

setTextContent

public final void setTextContent(java.lang.String textContent)
                          throws org.w3c.dom.DOMException
Specified by:
setTextContent in interface org.w3c.dom.Node
Overrides:
setTextContent in class AbstractNode
Throws:
org.w3c.dom.DOMException