org.enhydra.xml.lazydom
Class LazyElementNS

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.ElementImpl
                          |
                          +--org.enhydra.apache.xerces.dom.ElementNSImpl
                                |
                                +--org.enhydra.xml.lazydom.LazyElementNS
All Implemented Interfaces:
Cloneable, Element, EventTarget, LazyElement, LazyNode, LazyParent, Node, NodeList, PreFormattedText, Serializable

public class LazyElementNS
extends org.enhydra.apache.xerces.dom.ElementNSImpl
implements LazyElement

Implementation of the DOM Element with namespaces that supports lazy instantiation of a template DOM.

See Also:
Serialized Form

Fields inherited from class org.enhydra.apache.xerces.dom.ElementNSImpl
localName, namespaceURI, serialVersionUID, xmlURI
 
Fields inherited from class org.enhydra.apache.xerces.dom.ElementImpl
attributes, name
 
Fields inherited from class org.enhydra.apache.xerces.dom.ParentNode
fCachedChild, fCachedChildIndex, fCachedLength, firstChild, ownerDocument
 
Fields inherited from class org.enhydra.apache.xerces.dom.ChildNode
nextSibling, previousSibling
 
Fields inherited from class org.enhydra.apache.xerces.dom.NodeImpl
ELEMENT_DEFINITION_NODE, FIRSTCHILD, flags, HASSTRING, IGNORABLEWS, OWNED, ownerNode, READONLY, SPECIFIED, SYNCCHILDREN, SYNCDATA, UNNORMALIZED
 
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
 
Fields inherited from interface org.enhydra.xml.lazydom.LazyNode
DOCUMENT_NODE_ID, NULL_NODE_ID
 
Constructor Summary
protected LazyElementNS(LazyDocument ownerDoc, LazyElement template, String namespaceURI, String qualifiedName)
          Constructor.
 
Method Summary
 Node appendChild(Node newChild)
           
 void appendChildWhileExpanding(Node child)
          Append a child during node expansion.
 boolean areAttributesExpanded()
          Are the attributes of this node expanded?
 boolean areChildrenExpanded()
          Are the children of this node expanded?
 Node cloneNode(boolean deep)
           
 String getAttribute(String name)
           
 Attr getAttributeNode(String name)
           
 Attr getAttributeNodeNS(String namespaceURI, String localName)
           
 String getAttributeNS(String namespaceURI, String localName)
           
 NamedNodeMap getAttributes()
           
 NodeList getChildNodes()
           
 Node getFirstChild()
           
 Node getLastChild()
           
 Node getNextSibling()
           
 int getNodeId()
          Get the node numeric id number.
 Node getParentNode()
           
 String getPreFormattedText()
          Get the pre-formatted text for a node.
 Node getPreviousSibling()
           
 LazyElement getTemplateElement()
          Get the template for this node.
 LazyNode getTemplateNode()
          Get the template node as a LazyNode.
 boolean hasChildNodes()
           
 Node insertBefore(Node newChild, Node refChild)
           
 boolean isParentExpanded()
          Is the parent of this node expanded?
 boolean isTemplateNode()
          Check if this node is a template node.
 void makeTemplateNode(int nodeId)
           
 void makeTemplateNode(int nodeId, String text)
          Mark the node as a template node and associated preformatted text.
 void normalize()
           
 void removeAttribute(String name)
           
 Attr removeAttributeNode(Attr oldAttr)
           
 void removeAttributeNS(String namespaceURI, String localName)
           
 Node removeChild(Node oldChild)
           
 Node replaceChild(Node newChild, Node oldChild)
           
 void setAttribute(String name, String value)
           
 Attr setAttributeNode(Attr newAttr)
           
 Attr setAttributeNodeNS(Attr newAttr)
           
 void setAttributeNS(String namespaceURI, String qualifiedName, String value)
           
 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 setPreFormattedText(String text)
          Set the pre-formatted text for a node.
 LazyNode templateClone(Document ownerDocument)
          Create a new node, using this node as the template.
 
Methods inherited from class org.enhydra.apache.xerces.dom.ElementNSImpl
getLocalName, getNamespaceURI, getPrefix, setPrefix
 
Methods inherited from class org.enhydra.apache.xerces.dom.ElementImpl
getDefaultAttributes, getElementsByTagName, getElementsByTagNameNS, getNodeName, getNodeType, getSchemaTypeInfo, getTagName, hasAttribute, hasAttributeNS, hasAttributes, reconcileDefaultAttributes, setIdAttribute, setIdAttributeNode, setIdAttributeNS, setOwnerDocument, setReadOnly, setupDefaultAttributes, synchronizeData
 
Methods inherited from class org.enhydra.apache.xerces.dom.ParentNode
checkNormalizationAfterInsert, checkNormalizationAfterRemove, getChildNodesUnoptimized, getLength, getOwnerDocument, internalInsertBefore, internalRemoveChild, item, lastChild, lastChild, ownerDocument, synchronizeChildren
 
Methods inherited from class org.enhydra.apache.xerces.dom.ChildNode
parentNode, previousSibling
 
Methods inherited from class org.enhydra.apache.xerces.dom.NodeImpl
addEventListener, changed, changes, compareDocumentPosition, dispatchEvent, getBaseURI, getFeature, getNodeValue, getReadOnly, getTextContent, getUserData, getUserData, hasStringValue, hasStringValue, internalIsIgnorableWhitespace, isDefaultNamespace, isEqualNode, isFirstChild, isFirstChild, isIgnorableWhitespace, isNormalized, isNormalized, isOwned, isOwned, isReadOnly, isReadOnly, isSameNode, isSpecified, isSpecified, isSupported, lookupNamespaceURI, lookupPrefix, needsSyncChildren, needsSyncChildren, needsSyncData, needsSyncData, removeEventListener, setTextContent, setUserData, setUserData, toString
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.w3c.dom.Element
getElementsByTagName, getElementsByTagNameNS, getSchemaTypeInfo, getTagName, hasAttribute, hasAttributeNS, setIdAttribute, setIdAttributeNode, setIdAttributeNS
 
Methods inherited from interface org.w3c.dom.Node
compareDocumentPosition, getBaseURI, getFeature, getLocalName, getNamespaceURI, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getPrefix, getTextContent, getUserData, hasAttributes, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, setPrefix, setTextContent, setUserData
 

Constructor Detail

LazyElementNS

protected LazyElementNS(LazyDocument ownerDoc,
                        LazyElement template,
                        String namespaceURI,
                        String qualifiedName)
Constructor.
Parameters:
ownerDoc - The document that owns this node.
template - If not-null, get the parameters from this template.
namespaceURI - The namespace for the node. Will be ignored if template is not-null.
qualifiedName - The tag name for the node. Will be ignored if template is not-null.
Method Detail

makeTemplateNode

public void makeTemplateNode(int nodeId,
                             String text)
Mark the node as a template node and associated preformatted text.
Specified by:
makeTemplateNode in interface LazyElement
See Also:
LazyNode.makeTemplateNode(int), PreFormattedText.setPreFormattedText(java.lang.String)

getTemplateElement

public LazyElement getTemplateElement()
Get the template for this node.
Specified by:
getTemplateElement in interface LazyElement
See Also:
LazyNode.getTemplateNode()

cloneNode

public Node cloneNode(boolean deep)
Specified by:
cloneNode in interface Node
Overrides:
cloneNode in class org.enhydra.apache.xerces.dom.ElementImpl
See Also:
Node.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)

getParentNode

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

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()

getPreviousSibling

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

getNextSibling

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

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.ParentNode
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.ParentNode
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.ParentNode
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.ElementImpl
See Also:
Node.normalize()

areAttributesExpanded

public boolean areAttributesExpanded()
Are the attributes of this node expanded?
Specified by:
areAttributesExpanded in interface LazyElement

getAttributes

public NamedNodeMap getAttributes()
Specified by:
getAttributes in interface Node
Overrides:
getAttributes in class org.enhydra.apache.xerces.dom.ElementImpl
See Also:
Node.getAttributes()

getAttribute

public String getAttribute(String name)
Specified by:
getAttribute in interface Element
Overrides:
getAttribute in class org.enhydra.apache.xerces.dom.ElementImpl
See Also:
Element.getAttribute(java.lang.String)

setAttribute

public void setAttribute(String name,
                         String value)
                  throws DOMException
Specified by:
setAttribute in interface Element
Overrides:
setAttribute in class org.enhydra.apache.xerces.dom.ElementImpl
See Also:
Element.setAttribute(java.lang.String, java.lang.String)

removeAttribute

public void removeAttribute(String name)
                     throws DOMException
Specified by:
removeAttribute in interface Element
Overrides:
removeAttribute in class org.enhydra.apache.xerces.dom.ElementImpl
See Also:
Element.removeAttribute(java.lang.String)

getAttributeNode

public Attr getAttributeNode(String name)
Specified by:
getAttributeNode in interface Element
Overrides:
getAttributeNode in class org.enhydra.apache.xerces.dom.ElementImpl
See Also:
Element.getAttributeNode(java.lang.String)

setAttributeNode

public Attr setAttributeNode(Attr newAttr)
                      throws DOMException
Specified by:
setAttributeNode in interface Element
Overrides:
setAttributeNode in class org.enhydra.apache.xerces.dom.ElementImpl
See Also:
Element.setAttributeNode(org.w3c.dom.Attr)

removeAttributeNode

public Attr removeAttributeNode(Attr oldAttr)
                         throws DOMException
Specified by:
removeAttributeNode in interface Element
Overrides:
removeAttributeNode in class org.enhydra.apache.xerces.dom.ElementImpl
See Also:
Element.removeAttributeNode(org.w3c.dom.Attr)

getAttributeNS

public String getAttributeNS(String namespaceURI,
                             String localName)
Specified by:
getAttributeNS in interface Element
Overrides:
getAttributeNS in class org.enhydra.apache.xerces.dom.ElementImpl
See Also:
Element.getAttributeNS(java.lang.String, java.lang.String)

setAttributeNS

public void setAttributeNS(String namespaceURI,
                           String qualifiedName,
                           String value)
                    throws DOMException
Specified by:
setAttributeNS in interface Element
Overrides:
setAttributeNS in class org.enhydra.apache.xerces.dom.ElementImpl
See Also:
Element.setAttributeNS(java.lang.String, java.lang.String, java.lang.String)

removeAttributeNS

public void removeAttributeNS(String namespaceURI,
                              String localName)
                       throws DOMException
Specified by:
removeAttributeNS in interface Element
Overrides:
removeAttributeNS in class org.enhydra.apache.xerces.dom.ElementImpl
See Also:
Element.removeAttributeNS(java.lang.String, java.lang.String)

getAttributeNodeNS

public Attr getAttributeNodeNS(String namespaceURI,
                               String localName)
Specified by:
getAttributeNodeNS in interface Element
Overrides:
getAttributeNodeNS in class org.enhydra.apache.xerces.dom.ElementImpl
See Also:
Element.getAttributeNodeNS(java.lang.String, java.lang.String)

setAttributeNodeNS

public Attr setAttributeNodeNS(Attr newAttr)
                        throws DOMException
Specified by:
setAttributeNodeNS in interface Element
Overrides:
setAttributeNodeNS in class org.enhydra.apache.xerces.dom.ElementImpl
See Also:
Element.setAttributeNodeNS(org.w3c.dom.Attr)

getPreFormattedText

public String getPreFormattedText()
Description copied from interface: PreFormattedText
Get the pre-formatted text for a node.
Specified by:
getPreFormattedText in interface PreFormattedText
See Also:
PreFormattedText.getPreFormattedText()

setPreFormattedText

public void setPreFormattedText(String text)
Description copied from interface: PreFormattedText
Set the pre-formatted text for a node.
Specified by:
setPreFormattedText in interface PreFormattedText
See Also:
PreFormattedText.setPreFormattedText(java.lang.String)


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