org.enhydra.xml.lazydom
Class LazyDocument

java.lang.Object
  |
  +--org.enhydra.apache.xerces.dom.NodeImpl
        |
        +--org.enhydra.apache.xerces.dom.ChildNode
              |
              +--org.enhydra.apache.xerces.dom.ParentNode
                    |
                    +--org.enhydra.apache.xerces.dom.CoreDocumentImpl
                          |
                          +--org.enhydra.apache.xerces.dom.DocumentImpl
                                |
                                +--org.enhydra.xml.lazydom.LazyDocument
All Implemented Interfaces:
Cloneable, Document, DocumentEvent, DocumentRange, DocumentTraversal, EventTarget, LazyNode, LazyParent, Node, NodeList, PreFormattedTextDocument, Serializable, XMLObjectLink
Direct Known Subclasses:
LazyHTMLDocument

public class LazyDocument
extends org.enhydra.apache.xerces.dom.DocumentImpl
implements LazyParent, PreFormattedTextDocument, XMLObjectLink

A DOM Document that supports lazy instantiation of a template DOM. Nodes in the instance DOM are created as accessed. This can be either by traversing the tree or by direct access to a node by id number. Instantiation of nodes in the middle of the virtual tree is support. Thus a node can exist without a parent being expanded. This is used by XMLC, where the dynamic nodes tend to be towards the leaves of the tree.

Instances contain a reference to a DOM that is a shared template for the document. Each node in the template is assigned an integer node id that be used to index tables to directly look up the template of a node created from the template.

This DOM also supports associating pre-formatted text with some nodes, which is used to avoid expensive string scanning operations during the output of unmodified nodes.

When a child of a node is requested, all direct children are expanded. This eliminates a lot of difficult book keep. Attributes are treated as a separate set from children, only instantiated when an attribute is accessed. Expansion of nodes accesed from an existing node works as follows:

This coarse-grained locking approach minimizes the number of locks * on the assumption that collisions do not occur frequently

To created an extended DOM, one must override both the factory methods that take strings and those that take node ids.

See Also:
Serialized Form

Inner classes inherited from class org.enhydra.apache.xerces.dom.DocumentImpl
org.enhydra.apache.xerces.dom.DocumentImpl.EnclosingAttr, org.enhydra.apache.xerces.dom.DocumentImpl.LEntry
 
Inner classes inherited from class org.enhydra.apache.xerces.dom.ParentNode
org.enhydra.apache.xerces.dom.ParentNode.UserDataRecord
 
Field Summary
protected  TemplateDOM fTemplateDOM
          Template document DOM.
 
Fields inherited from class org.enhydra.apache.xerces.dom.DocumentImpl
eventListeners, iterators, mutationEvents, ranges, savedEnclosingAttr, serialVersionUID
 
Fields inherited from class org.enhydra.apache.xerces.dom.CoreDocumentImpl
actualEncoding, allowGrammarAccess, changes, docElement, docType, domNormalizer, encoding, errorChecking, fConfiguration, fDocumentURI, fFreeNLCache, fXPathEvaluator, identifiers, standalone, userData, version, xmlVersionChanged
 
Fields inherited from class org.enhydra.apache.xerces.dom.ParentNode
firstChild, fNodeListCache, ownerDocument
 
Fields inherited from class org.enhydra.apache.xerces.dom.ChildNode
nextSibling, previousSibling
 
Fields inherited from class org.enhydra.apache.xerces.dom.NodeImpl
DOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_DISCONNECTED, DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, DOCUMENT_POSITION_IS_CONTAINED, DOCUMENT_POSITION_PRECEDING, ELEMENT_DEFINITION_NODE, FIRSTCHILD, flags, HASSTRING, ID, IGNORABLEWS, NORMALIZED, OWNED, ownerNode, READONLY, SPECIFIED, SYNCCHILDREN, SYNCDATA, TREE_POSITION_ANCESTOR, TREE_POSITION_DESCENDANT, TREE_POSITION_DISCONNECTED, TREE_POSITION_EQUIVALENT, TREE_POSITION_FOLLOWING, TREE_POSITION_PRECEDING, TREE_POSITION_SAME_NODE
 
Fields inherited from interface org.enhydra.xml.lazydom.LazyNode
DOCUMENT_NODE_ID, NULL_NODE_ID
 
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
LazyDocument()
          Constructor with no argument, for LazyHTMLDocument.
LazyDocument(DocumentType documentType, TemplateDOM templateDOM)
          Constructor.
 
Method Summary
 Node appendChild(Node newChild)
           
 void appendChildWhileExpanding(Node child)
          Append a child during node expansion.
 boolean areChildrenExpanded()
          Are the children of this node expanded?
 LazyDocument cloneAsTemplateDocument(TemplateDOM templateDOM)
          Subclasses should override this, returning the subclass built with the provided template DOM.
 Node cloneNode(boolean deep)
          Subclasses should override this, returning the subclass built with the template DOM, if the current document was built with the template DOM.
protected  void cloneNode(LazyDocument newdoc, boolean deep)
           
 LazyAttr createAttribute(int nodeId)
          Create an attribute from a template given its id.
 Attr createAttribute(String name)
           
 Attr createAttributeNS(String namespaceURI, String qualifiedName)
           
 LazyAttr createAttributeNS(String namespaceURI, String qualifiedName, int nodeId)
          Create a template Attr with namespace.
 Attr createAttributeNS(String namespaceURI, String qualifiedName, String localpart)
           
 LazyCDATASection createCDATASection(int nodeId)
          Create a CDATASection from a template given its id.
 CDATASection createCDATASection(String data)
           
 LazyComment createComment(int nodeId)
          Create a comment from a template given its id.
 Comment createComment(String data)
           
 LazyDocumentType createDocumentType(int nodeId)
          Create a new DocumentType object (Non-DOM).
 DocumentType createDocumentType(String qualifiedName, String publicID, String systemID)
          Create a new DocumentType object (Non-DOM).
 DocumentType createDocumentType(String qualifiedName, String publicID, String systemID, String internalSubset)
          Create a new DocumentType object (Non-DOM).
 LazyElement createElement(int nodeId)
          Create a element from a template given its id.
 Element createElement(String tagName)
           
 Element createElementNS(String namespaceURI, String qualifiedName)
           
 Element createElementNS(String namespaceURI, String qualifiedName, String localpart)
           
 LazyEntity createEntity(int nodeId)
          Create a new Entity object (Non-DOM).
 Entity createEntity(String name)
          Create a new Entity object (Non-DOM).
 LazyEntityReference createEntityReference(int nodeId)
          Create a entity reference from a template given its id.
 EntityReference createEntityReference(String name)
           
 LazyNotation createNotation(int nodeId)
          Create a notation node from a template given its id.
 Notation createNotation(String name)
          See org.w3c.dom.Document#createNotation
 LazyProcessingInstruction createProcessingInstruction(int nodeId)
          Create a process instruction node from a template given its id.
 ProcessingInstruction createProcessingInstruction(String target, String data)
           
 LazyAttr createTemplateAttribute(String name, int nodeId)
          Create a template Attr.
 LazyAttr createTemplateAttributeNS(String namespaceURI, String qualifiedName, int nodeId)
          Create a template Attr.
 LazyCDATASection createTemplateCDATASection(String data, int nodeId)
          Create a template CDATASection.
 LazyComment createTemplateComment(String data, int nodeId)
          Create a template comment.
 LazyDocumentType createTemplateDocumentType(String qualifiedName, String publicID, String systemID, String internalSubset, int nodeId)
          Create a template DocumentType.
 LazyElement createTemplateElement(String tagName, int nodeId, String preFormattedText)
          Create a template element.
 LazyElement createTemplateElementNS(String namespaceURI, String qualifiedName, int nodeId, String preFormattedText)
          Create a template Element with namespace.
 LazyEntity createTemplateEntity(String name, String publicId, String systemId, String notationName, int nodeId)
          Create a template Entity.
 LazyEntityReference createTemplateEntityReference(String name, int nodeId)
          Create a template EntityReference.
 LazyNotation createTemplateNotation(String name, int nodeId)
          Create a template Notation.
 LazyProcessingInstruction createTemplateProcessingInstruction(String target, String data, int nodeId)
          Create a template ProcessingInstruction.
 LazyText createTemplateTextNode(String data, int nodeId, String preFormattedText)
          Create a template text node.
 LazyText createTextNode(int nodeId)
          Create a text node from a template given its id.
 Text createTextNode(String data)
           
protected  void doExpandChildren(LazyParent node)
          Do work of expanding the children of a node, if they are not already expanded.
protected  void doExpandParent(LazyParent node)
          Do work of expanding the parent of a node, if it is not already expanded.
protected  void enterExpansion()
          Flag that an expansion is in progress, which is used to detect recursion.
 NodeList getChildNodes()
           
 DocumentType getDoctype()
           
 Element getDocumentElement()
           
 LazyNode getExpandedNode(int nodeId)
          Get a pointer to a node if its been expanded, otherwise return null.
 Node getFirstChild()
           
 Element getIdentifier(String idName)
          Overrides Xerces implementation, which checks that the parent document of the element with the given idName is the same as this.
 DOMImplementation getImplementation()
           
 Node getLastChild()
           
 LazyNode getNodeById(int nodeId)
          Get or create a lazy node, given its id.
 LazyNode getNodeFromTemplate(LazyNode template)
          Get or create a node given, the template node.
 int getNodeId()
          Get the node numeric id number.
 OutputOptions getPreFormatOutputOptions()
          Get the OutputOption that were used to format the document.
 LazyDocument getTemplateDocument()
          Get the template for this node.
 LazyNode getTemplateNode()
          Get the template node as a LazyNode.
 LazyNode getTemplateNode(int nodeId)
          Get a template node, given a node id.
 XMLObject getXMLObject()
          Get the XMLC XMLObject that contains this document, or null it it's not associated with a XMLObject.
 boolean hasChildNodes()
           
 Node insertBefore(Node newChild, Node refChild)
           
 boolean isDocTypeExpanded()
          Has the DocumentType been expanded?
 boolean isParentExpanded()
          Is the parent of this node expanded?
 boolean isTemplateNode()
          Check if this node is a template node.
protected  void leaveExpansion()
          Flag that an expansion is complete.
 void makeTemplateNode(int nodeId)
           
 void normalize()
           
 Node removeChild(Node oldChild)
           
 Node replaceChild(Node newChild, Node oldChild)
           
 void setChildrenExpanded()
          Flag the children as being expanded.
 void setNodeValue(String value)
          Set the node value, invalidating the id.
 void setParentExpanded()
          Flag the parent as being expanded.
 void setParentWhileExpanding(Node parent)
          Set the parent of this node during expansion.
 void setPreFormatOutputOptions(OutputOptions outputOptions)
          Set the output options that were used to preformat this document.
 void setXMLObject(XMLObject xmlObject)
          Set the XMLC XMLObject that contains this document.
 LazyNode templateClone(Document ownerDocument)
          Create a new node, using this node as the template.
 
Methods inherited from class org.enhydra.apache.xerces.dom.DocumentImpl
addEventListener, copyEventListeners, createEvent, createNodeIterator, createNodeIterator, createRange, createTreeWalker, createTreeWalker, deletedText, dispatchAggregateEvents, dispatchAggregateEvents, dispatchEvent, dispatchEventToSubtree, dispatchingEventToSubtree, getEventListeners, getMutationEvents, insertedNode, insertedText, insertingNode, modifiedAttrValue, modifiedCharacterData, modifyingCharacterData, removedAttrNode, removedNode, removeEventListener, removeNodeIterator, removeRange, removingNode, renamedAttrNode, renamedElement, replacedCharacterData, replacedNode, replacedText, replacingData, replacingNode, saveEnclosingAttr, setAttrNode, setEventListeners, setMutationEvents, splitData
 
Methods inherited from class org.enhydra.apache.xerces.dom.CoreDocumentImpl
, abort, adoptNode, callUserDataHandlers, callUserDataHandlers, changed, changes, checkDOMNSErr, checkNamespaceWF, checkQName, clearIdentifiers, clone, cloneNode, createDocumentFragment, createElementDefinition, freeNodeListCache, getAsync, getBaseURI, getDocumentURI, getDomConfig, getElementById, getElementsByTagName, getElementsByTagNameNS, getEncoding, getErrorChecking, getFeature, getIdentifiers, getInputEncoding, getNodeListCache, getNodeName, getNodeNumber, getNodeNumber, getNodeType, getOwnerDocument, getStandalone, getStrictErrorChecking, getTextContent, getUserData, getUserData, getUserDataRecord, getVersion, getXmlEncoding, getXmlStandalone, getXmlVersion, importNode, isKidOK, isNormalizeDocRequired, isValidQName, isXML11Version, isXMLName, isXMLVersionChanged, load, loadXML, normalizeDocument, putIdentifier, removeIdentifier, removeUserDataTable, renameNode, saveXML, setAsync, setDocumentURI, setEncoding, setErrorChecking, setInputEncoding, setStandalone, setStrictErrorChecking, setTextContent, setUserData, setUserData, setUserDataTable, setVersion, setXmlEncoding, setXmlStandalone, setXmlVersion, undeferChildren
 
Methods inherited from class org.enhydra.apache.xerces.dom.ParentNode
checkNormalizationAfterInsert, checkNormalizationAfterRemove, getChildNodesUnoptimized, getLength, getTextContent, hasTextContent, internalInsertBefore, internalRemoveChild, isEqualNode, item, lastChild, lastChild, ownerDocument, setOwnerDocument, setReadOnly, synchronizeChildren
 
Methods inherited from class org.enhydra.apache.xerces.dom.ChildNode
getNextSibling, getParentNode, getPreviousSibling, parentNode, previousSibling
 
Methods inherited from class org.enhydra.apache.xerces.dom.NodeImpl
addEventListener, compareDocumentPosition, compareTreePosition, dispatchEvent, getAttributes, getContainer, getElementAncestor, getLocalName, getNamespaceURI, getNodeValue, getPrefix, getReadOnly, getUserData, getUserData, getUserDataRecord, hasAttributes, hasStringValue, hasStringValue, internalIsIgnorableWhitespace, isDefaultNamespace, isFirstChild, isFirstChild, isIdAttribute, isIdAttribute, isIgnorableWhitespace, isNormalized, isNormalized, isOwned, isOwned, isReadOnly, isReadOnly, isSameNode, isSpecified, isSpecified, isSupported, lookupNamespacePrefix, lookupNamespaceURI, lookupPrefix, needsSyncChildren, needsSyncChildren, needsSyncData, needsSyncData, removeEventListener, setPrefix, setUserData, setUserData, synchronizeData, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.w3c.dom.Node
compareDocumentPosition, getAttributes, getBaseURI, getFeature, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, getTextContent, getUserData, hasAttributes, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, setPrefix, setTextContent, setUserData
 

Field Detail

fTemplateDOM

protected TemplateDOM fTemplateDOM
Template document DOM. This is shared by all instances and must not be modified.
Constructor Detail

LazyDocument

public LazyDocument(DocumentType documentType,
                    TemplateDOM templateDOM)
Constructor.
Parameters:
documentType - Document type to associate with this document, or null if no doctype or should be obtained from template.
templateDOM - Template DOM, with each node cotaining a node id. Maybe null if no associated template.

LazyDocument

public LazyDocument()
Constructor with no argument, for LazyHTMLDocument.
Method Detail

getDocumentElement

public Element getDocumentElement()
Overrides:
getDocumentElement in class org.enhydra.apache.xerces.dom.CoreDocumentImpl
See Also:
Document.getDocumentElement()

getImplementation

public DOMImplementation getImplementation()
Overrides:
getImplementation in class org.enhydra.apache.xerces.dom.DocumentImpl
See Also:
Document.getImplementation()

enterExpansion

protected final void enterExpansion()
Flag that an expansion is in progress, which is used to detect recursion. MUST be synchronized on document.

leaveExpansion

protected final void leaveExpansion()
Flag that an expansion is complete. MUST be synchronized on document.

getNodeById

public final LazyNode getNodeById(int nodeId)
Get or create a lazy node, given its id. Expanding if it doesn't exist. All node creation must go through here so that a derived document create factory is used.

getNodeFromTemplate

public final LazyNode getNodeFromTemplate(LazyNode template)
Get or create a node given, the template node.
See Also:
getNodeById(int)

doExpandParent

protected void doExpandParent(LazyParent node)
Do work of expanding the parent of a node, if it is not already expanded. This also expands the children, as this keeps the expansion bookkeeping simple and getting a parent not a common operation except to access a sibling or add a new sibling Only used internally to this package.

doExpandChildren

protected void doExpandChildren(LazyParent node)
Do work of expanding the children of a node, if they are not already expanded. Only lazy parent's have a flag for siblings, as data nodes can never be accessed without going through the parent and expanding the children. Only used internally to this package.

getExpandedNode

public final LazyNode getExpandedNode(int nodeId)
Get a pointer to a node if its been expanded, otherwise return null.

getTemplateNode

public final LazyNode getTemplateNode(int nodeId)
Get a template node, given a node id.

isDocTypeExpanded

public boolean isDocTypeExpanded()
Has the DocumentType been expanded?

getTemplateDocument

public LazyDocument getTemplateDocument()
Get the template for this node.
See Also:
LazyNode.getTemplateNode()

cloneNode

public Node cloneNode(boolean deep)
Subclasses should override this, returning the subclass built with the template DOM, if the current document was built with the template DOM. Otherwise, clone using the 2 argument cloneNode(LazyDocument, boolean).
Specified by:
cloneNode in interface Node
Overrides:
cloneNode in class org.enhydra.apache.xerces.dom.DocumentImpl
See Also:
Node.cloneNode(boolean)

cloneAsTemplateDocument

public LazyDocument cloneAsTemplateDocument(TemplateDOM templateDOM)
Subclasses should override this, returning the subclass built with the provided template DOM.
Parameters:
templateDOM -  
Returns:
 

getIdentifier

public final Element getIdentifier(String idName)
Overrides Xerces implementation, which checks that the parent document of the element with the given idName is the same as this. That isn't the case when the element is from a template DOM. Additionally the returned element needs to be obtained by Id and checked for expansion. Made final since subclasses have no business managing identifiers.
Overrides:
getIdentifier in class org.enhydra.apache.xerces.dom.CoreDocumentImpl
See Also:
getNodeFromTemplate(LazyNode)

cloneNode

protected void cloneNode(LazyDocument newdoc,
                         boolean deep)
See Also:
cloneNode(boolean)

makeTemplateNode

public void makeTemplateNode(int nodeId)
Specified by:
makeTemplateNode in interface LazyNode

getNodeId

public int getNodeId()
Description copied from interface: LazyNode
Get the node numeric id number.
Specified by:
getNodeId in interface LazyNode
See Also:
LazyNode.getNodeId()

isTemplateNode

public boolean isTemplateNode()
Description copied from interface: LazyNode
Check if this node is a template node.
Specified by:
isTemplateNode in interface LazyNode
See Also:
LazyNode.isTemplateNode()

getTemplateNode

public LazyNode getTemplateNode()
Description copied from interface: LazyNode
Get the template node as a LazyNode.
Specified by:
getTemplateNode in interface LazyNode
See Also:
LazyNode.getTemplateNode()

templateClone

public LazyNode templateClone(Document ownerDocument)
Description copied from interface: LazyNode
Create a new node, using this node as the template.
Specified by:
templateClone in interface LazyNode
See Also:
LazyNode.templateClone(org.w3c.dom.Document)

setNodeValue

public void setNodeValue(String value)
Set the node value, invalidating the id. All node data is modified by this routine.
Specified by:
setNodeValue in interface Node
Overrides:
setNodeValue in class org.enhydra.apache.xerces.dom.NodeImpl
See Also:
Node.setNodeValue(java.lang.String)

isParentExpanded

public boolean isParentExpanded()
Description copied from interface: LazyParent
Is the parent of this node expanded?
Specified by:
isParentExpanded in interface LazyParent
See Also:
LazyParent.isParentExpanded()

setParentExpanded

public void setParentExpanded()
Description copied from interface: LazyParent
Flag the parent as being expanded.
Specified by:
setParentExpanded in interface LazyParent
See Also:
LazyParent.setParentExpanded()

setParentWhileExpanding

public void setParentWhileExpanding(Node parent)
Description copied from interface: LazyParent
Set the parent of this node during expansion. This should also flag the parent as being expanded.
Specified by:
setParentWhileExpanding in interface LazyParent
See Also:
LazyParent.setParentWhileExpanding(org.w3c.dom.Node)

areChildrenExpanded

public boolean areChildrenExpanded()
Description copied from interface: LazyParent
Are the children of this node expanded?
Specified by:
areChildrenExpanded in interface LazyParent
See Also:
LazyParent.areChildrenExpanded()

setChildrenExpanded

public void setChildrenExpanded()
Description copied from interface: LazyParent
Flag the children as being expanded.
Specified by:
setChildrenExpanded in interface LazyParent
See Also:
LazyParent.setChildrenExpanded()

appendChildWhileExpanding

public void appendChildWhileExpanding(Node child)
Description copied from interface: LazyParent
Append a child during node expansion. This should only add the child, not trigger any other expansion.
Specified by:
appendChildWhileExpanding in interface LazyParent
See Also:
LazyParent.appendChildWhileExpanding(org.w3c.dom.Node)

getChildNodes

public NodeList getChildNodes()
Specified by:
getChildNodes in interface Node
Overrides:
getChildNodes in class org.enhydra.apache.xerces.dom.ParentNode
See Also:
Node.getChildNodes()

getFirstChild

public Node getFirstChild()
Specified by:
getFirstChild in interface Node
Overrides:
getFirstChild in class org.enhydra.apache.xerces.dom.ParentNode
See Also:
Node.getFirstChild()

getLastChild

public Node getLastChild()
Specified by:
getLastChild in interface Node
Overrides:
getLastChild in class org.enhydra.apache.xerces.dom.ParentNode
See Also:
Node.getLastChild()

insertBefore

public Node insertBefore(Node newChild,
                         Node refChild)
                  throws DOMException
Specified by:
insertBefore in interface Node
Overrides:
insertBefore in class org.enhydra.apache.xerces.dom.CoreDocumentImpl
See Also:
Node.insertBefore(org.w3c.dom.Node, org.w3c.dom.Node)

replaceChild

public Node replaceChild(Node newChild,
                         Node oldChild)
                  throws DOMException
Specified by:
replaceChild in interface Node
Overrides:
replaceChild in class org.enhydra.apache.xerces.dom.CoreDocumentImpl
See Also:
Node.replaceChild(org.w3c.dom.Node, org.w3c.dom.Node)

removeChild

public Node removeChild(Node oldChild)
                 throws DOMException
Specified by:
removeChild in interface Node
Overrides:
removeChild in class org.enhydra.apache.xerces.dom.CoreDocumentImpl
See Also:
Node.removeChild(org.w3c.dom.Node)

appendChild

public Node appendChild(Node newChild)
                 throws DOMException
Specified by:
appendChild in interface Node
Overrides:
appendChild in class org.enhydra.apache.xerces.dom.NodeImpl
See Also:
Node.appendChild(org.w3c.dom.Node)

hasChildNodes

public boolean hasChildNodes()
Specified by:
hasChildNodes in interface Node
Overrides:
hasChildNodes in class org.enhydra.apache.xerces.dom.ParentNode
See Also:
Node.hasChildNodes()

normalize

public void normalize()
Specified by:
normalize in interface Node
Overrides:
normalize in class org.enhydra.apache.xerces.dom.ParentNode
See Also:
Node.normalize()

getDoctype

public DocumentType getDoctype()
Overrides:
getDoctype in class org.enhydra.apache.xerces.dom.CoreDocumentImpl
See Also:
Document.getDoctype()

createElement

public Element createElement(String tagName)
                      throws DOMException
Overrides:
createElement in class org.enhydra.apache.xerces.dom.CoreDocumentImpl
See Also:
Document.createElement(java.lang.String)

createTextNode

public Text createTextNode(String data)
Overrides:
createTextNode in class org.enhydra.apache.xerces.dom.CoreDocumentImpl
See Also:
Document.createTextNode(java.lang.String)

createComment

public Comment createComment(String data)
Overrides:
createComment in class org.enhydra.apache.xerces.dom.CoreDocumentImpl
See Also:
Document.createComment(java.lang.String)

createCDATASection

public CDATASection createCDATASection(String data)
                                throws DOMException
Overrides:
createCDATASection in class org.enhydra.apache.xerces.dom.CoreDocumentImpl
See Also:
Document.createCDATASection(java.lang.String)

createProcessingInstruction

public ProcessingInstruction createProcessingInstruction(String target,
                                                         String data)
Overrides:
createProcessingInstruction in class org.enhydra.apache.xerces.dom.CoreDocumentImpl
See Also:
Document.createProcessingInstruction(java.lang.String, java.lang.String)

createAttribute

public Attr createAttribute(String name)
                     throws DOMException
Overrides:
createAttribute in class org.enhydra.apache.xerces.dom.CoreDocumentImpl
See Also:
Document.createAttribute(java.lang.String)

createNotation

public Notation createNotation(String name)
                        throws DOMException
See org.w3c.dom.Document#createNotation
Overrides:
createNotation in class org.enhydra.apache.xerces.dom.CoreDocumentImpl

createEntityReference

public EntityReference createEntityReference(String name)
                                      throws DOMException
Overrides:
createEntityReference in class org.enhydra.apache.xerces.dom.CoreDocumentImpl
See Also:
Document.createEntityReference(java.lang.String)

createElementNS

public Element createElementNS(String namespaceURI,
                               String qualifiedName)
                        throws DOMException
Overrides:
createElementNS in class org.enhydra.apache.xerces.dom.CoreDocumentImpl
See Also:
Document.createElementNS(java.lang.String, java.lang.String)

createElementNS

public Element createElementNS(String namespaceURI,
                               String qualifiedName,
                               String localpart)
                        throws DOMException
Overrides:
createElementNS in class org.enhydra.apache.xerces.dom.CoreDocumentImpl

createAttributeNS

public Attr createAttributeNS(String namespaceURI,
                              String qualifiedName)
                       throws DOMException
Overrides:
createAttributeNS in class org.enhydra.apache.xerces.dom.CoreDocumentImpl
See Also:
Document.createAttributeNS(java.lang.String, java.lang.String)

createAttributeNS

public Attr createAttributeNS(String namespaceURI,
                              String qualifiedName,
                              String localpart)
                       throws DOMException
Overrides:
createAttributeNS in class org.enhydra.apache.xerces.dom.CoreDocumentImpl
See Also:
Document.createAttributeNS(java.lang.String, java.lang.String)

createDocumentType

public DocumentType createDocumentType(String qualifiedName,
                                       String publicID,
                                       String systemID,
                                       String internalSubset)
                                throws DOMException
Create a new DocumentType object (Non-DOM).
See Also:
CoreDocumentImpl.createDocumentType(java.lang.String, java.lang.String, java.lang.String)

createDocumentType

public DocumentType createDocumentType(String qualifiedName,
                                       String publicID,
                                       String systemID)
                                throws DOMException
Create a new DocumentType object (Non-DOM). This overrides the method in the Xerces DOM used by importNode().
Overrides:
createDocumentType in class org.enhydra.apache.xerces.dom.CoreDocumentImpl
See Also:
CoreDocumentImpl.createDocumentType(java.lang.String, java.lang.String, java.lang.String)

createEntity

public Entity createEntity(String name)
                    throws DOMException
Create a new Entity object (Non-DOM).
Overrides:
createEntity in class org.enhydra.apache.xerces.dom.CoreDocumentImpl
See Also:
CoreDocumentImpl.createEntity(java.lang.String)

createElement

public LazyElement createElement(int nodeId)
                          throws DOMException
Create a element from a template given its id.
See Also:
Document.createElement(java.lang.String)

createTextNode

public LazyText createTextNode(int nodeId)
Create a text node from a template given its id.
See Also:
Document.createTextNode(java.lang.String)

createComment

public LazyComment createComment(int nodeId)
Create a comment from a template given its id.
See Also:
Document.createComment(java.lang.String)

createCDATASection

public LazyCDATASection createCDATASection(int nodeId)
                                    throws DOMException
Create a CDATASection from a template given its id.
See Also:
Document.createCDATASection(java.lang.String)

createProcessingInstruction

public LazyProcessingInstruction createProcessingInstruction(int nodeId)
Create a process instruction node from a template given its id.
See Also:
Document.createProcessingInstruction(java.lang.String, java.lang.String)

createAttribute

public LazyAttr createAttribute(int nodeId)
                         throws DOMException
Create an attribute from a template given its id.
See Also:
Document.createAttribute(java.lang.String)

createNotation

public LazyNotation createNotation(int nodeId)
                            throws DOMException
Create a notation node from a template given its id. See org.w3c.dom.Document#createNotation

createEntityReference

public LazyEntityReference createEntityReference(int nodeId)
                                          throws DOMException
Create a entity reference from a template given its id.
See Also:
Document.createEntityReference(java.lang.String)

createDocumentType

public LazyDocumentType createDocumentType(int nodeId)
                                    throws DOMException
Create a new DocumentType object (Non-DOM).
See Also:
CoreDocumentImpl.createDocumentType(java.lang.String, java.lang.String, java.lang.String)

createEntity

public LazyEntity createEntity(int nodeId)
                        throws DOMException
Create a new Entity object (Non-DOM).
See Also:
CoreDocumentImpl.createEntity(java.lang.String)

createTemplateElement

public LazyElement createTemplateElement(String tagName,
                                         int nodeId,
                                         String preFormattedText)
                                  throws DOMException
Create a template element. This will call the derived document create method.
See Also:
createElement(String), Document.createElement(java.lang.String)

createTemplateTextNode

public LazyText createTemplateTextNode(String data,
                                       int nodeId,
                                       String preFormattedText)
Create a template text node. This will call the derived document create method.
See Also:
createTextNode(String), Document.createTextNode(java.lang.String)

createTemplateComment

public LazyComment createTemplateComment(String data,
                                         int nodeId)
Create a template comment. This will call the derived document create method.
See Also:
createComment(String), Document.createComment(java.lang.String)

createTemplateCDATASection

public LazyCDATASection createTemplateCDATASection(String data,
                                                   int nodeId)
                                            throws DOMException
Create a template CDATASection. This will call the derived document create method.
See Also:
createCDATASection(String), Document.createCDATASection(java.lang.String)

createTemplateProcessingInstruction

public LazyProcessingInstruction createTemplateProcessingInstruction(String target,
                                                                     String data,
                                                                     int nodeId)
Create a template ProcessingInstruction. This will call the derived document create method.
See Also:
createProcessingInstruction(String,String), Document.createProcessingInstruction(java.lang.String, java.lang.String)

createTemplateAttribute

public LazyAttr createTemplateAttribute(String name,
                                        int nodeId)
                                 throws DOMException
Create a template Attr. This will call the derived document create method.
See Also:
createAttribute(String), Document.createAttribute(java.lang.String)

createTemplateAttributeNS

public LazyAttr createTemplateAttributeNS(String namespaceURI,
                                          String qualifiedName,
                                          int nodeId)
                                   throws DOMException
Create a template Attr. This will call the derived document create method.
See Also:
createAttributeNS(String,String), Document.createAttributeNS(java.lang.String, java.lang.String)

createTemplateNotation

public LazyNotation createTemplateNotation(String name,
                                           int nodeId)
                                    throws DOMException
Create a template Notation. This will call the derived document create method. See org.w3c.dom.Document#createNotation
See Also:
createNotation(String)

createTemplateEntityReference

public LazyEntityReference createTemplateEntityReference(String name,
                                                         int nodeId)
                                                  throws DOMException
Create a template EntityReference. This will call the derived document create method.
See Also:
createEntityReference(String), Document.createEntityReference(java.lang.String)

createTemplateElementNS

public LazyElement createTemplateElementNS(String namespaceURI,
                                           String qualifiedName,
                                           int nodeId,
                                           String preFormattedText)
                                    throws DOMException
Create a template Element with namespace. This will call the derived document create method.
See Also:
createElementNS(String,String), Document.createElementNS(java.lang.String, java.lang.String)

createAttributeNS

public LazyAttr createAttributeNS(String namespaceURI,
                                  String qualifiedName,
                                  int nodeId)
                           throws DOMException
Create a template Attr with namespace. This will call the derived document create method.
See Also:
createAttributeNS(String,String), Document.createAttributeNS(java.lang.String, java.lang.String)

createTemplateDocumentType

public LazyDocumentType createTemplateDocumentType(String qualifiedName,
                                                   String publicID,
                                                   String systemID,
                                                   String internalSubset,
                                                   int nodeId)
                                            throws DOMException
Create a template DocumentType.
See Also:
createDocumentType(String,String,String,String), CoreDocumentImpl.createDocumentType(java.lang.String, java.lang.String, java.lang.String)

createTemplateEntity

public LazyEntity createTemplateEntity(String name,
                                       String publicId,
                                       String systemId,
                                       String notationName,
                                       int nodeId)
                                throws DOMException
Create a template Entity.
See Also:
createEntity(String), CoreDocumentImpl.createEntity(java.lang.String)

setPreFormatOutputOptions

public void setPreFormatOutputOptions(OutputOptions outputOptions)
Set the output options that were used to preformat this document.
Parameters:
outputOptions - The output options; should be read-only.

getPreFormatOutputOptions

public OutputOptions getPreFormatOutputOptions()
Description copied from interface: PreFormattedTextDocument
Get the OutputOption that were used to format the document.
Specified by:
getPreFormatOutputOptions in interface PreFormattedTextDocument
See Also:
PreFormattedTextDocument.getPreFormatOutputOptions()

setXMLObject

public void setXMLObject(XMLObject xmlObject)
Description copied from interface: XMLObjectLink
Set the XMLC XMLObject that contains this document.
Specified by:
setXMLObject in interface XMLObjectLink
See Also:
XMLObjectLink.setXMLObject(org.enhydra.xml.xmlc.XMLObject)

getXMLObject

public XMLObject getXMLObject()
Description copied from interface: XMLObjectLink
Get the XMLC XMLObject that contains this document, or null it it's not associated with a XMLObject.
Specified by:
getXMLObject in interface XMLObjectLink
See Also:
XMLObjectLink.getXMLObject()


Copyright © 1999-2002 enhydra.org (Mark Diekhans, David Li, Richard Kunze). All Rights reserved.