org.enhydra.xml.lazydom
Class LazyAttrNoNS

java.lang.Object
  |
  +--org.enhydra.apache.xerces.dom.NodeImpl
        |
        +--org.enhydra.apache.xerces.dom.AttrImpl
              |
              +--org.enhydra.xml.lazydom.LazyAttrNoNS
All Implemented Interfaces:
Attr, Cloneable, EventTarget, LazyAttr, LazyNode, LazyParent, Node, NodeList, Serializable

public class LazyAttrNoNS
extends org.enhydra.apache.xerces.dom.AttrImpl
implements LazyAttr

Implementation of the DOM Attr that supports lazy instantiation of a template DOM. This version does not support namespaaces. It is used by HTML, where non-standard attributes containing `:' are occasionally invented. If this was derived from AttrNSImpl, it would do validation on the name and generate an error.

See Also:
Serialized Form

Fields inherited from class org.enhydra.apache.xerces.dom.AttrImpl
name, serialVersionUID, textNode, value
 
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 LazyAttrNoNS(LazyDocument ownerDoc, LazyAttrNoNS template, String qualifiedName)
          Constructor with no namespace.
 
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?
 Node cloneNode(boolean deep)
           
 NodeList getChildNodes()
           
 Node getFirstChild()
           
 Node getLastChild()
           
 Node getNextSibling()
           
 int getNodeId()
          Get the node numeric id number.
 String getNodeValue()
           
 Node getParentNode()
           
 Node getPreviousSibling()
           
 LazyAttrNoNS getTemplateAttr()
          Get the template for this node.
 LazyNode getTemplateNode()
          Get the template node as a LazyNode.
 String getValue()
           
 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 normalize()
           
 Node removeChild(Node oldChild)
           
 Node replaceChild(Node newChild, Node oldChild)
           
 void setChildrenExpanded()
          Flag the children as being expanded.
 void setNodeValue(String nodeValue)
           
 void setParentExpanded()
          Flag the parent as being expanded.
 void setParentWhileExpanding(Node parent)
          Set the parent of this node during expansion.
 void setValue(String value)
           
 LazyNode templateClone(Document ownerDocument)
          Create a new node, using this node as the template.
 String toString()
          Return string for debugging.
 
Methods inherited from class org.enhydra.apache.xerces.dom.AttrImpl
, checkNormalizationAfterInsert, checkNormalizationAfterRemove, getElement, getLength, getName, getNodeName, getNodeType, getOwnerElement, getSchemaTypeInfo, getSpecified, internalInsertBefore, internalRemoveChild, isId, item, lastChild, lastChild, makeChildNode, setOwnerDocument, setReadOnly, setSpecified, synchronizeChildren
 
Methods inherited from class org.enhydra.apache.xerces.dom.NodeImpl
addEventListener, changed, changes, compareDocumentPosition, dispatchEvent, getAttributes, getBaseURI, getFeature, getLocalName, getNamespaceURI, getOwnerDocument, getPrefix, getReadOnly, getTextContent, getUserData, getUserData, hasAttributes, hasStringValue, hasStringValue, internalIsIgnorableWhitespace, isDefaultNamespace, isEqualNode, isFirstChild, isFirstChild, isIgnorableWhitespace, isNormalized, isNormalized, isOwned, isOwned, isReadOnly, isReadOnly, isSameNode, isSpecified, isSpecified, isSupported, lookupNamespaceURI, lookupPrefix, needsSyncChildren, needsSyncChildren, needsSyncData, needsSyncData, ownerDocument, parentNode, previousSibling, removeEventListener, setPrefix, setTextContent, setUserData, setUserData, synchronizeData
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.w3c.dom.Attr
getName, getOwnerElement, getSchemaTypeInfo, getSpecified, isId
 
Methods inherited from interface org.w3c.dom.Node
compareDocumentPosition, getAttributes, getBaseURI, getFeature, getLocalName, getNamespaceURI, getNodeName, getNodeType, getOwnerDocument, getPrefix, getTextContent, getUserData, hasAttributes, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, setPrefix, setTextContent, setUserData
 

Constructor Detail

LazyAttrNoNS

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

getTemplateAttr

public LazyAttrNoNS getTemplateAttr()
Get the template for this node.
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.AttrImpl
See Also:
Node.cloneNode(boolean)

getValue

public String getValue()
Specified by:
getValue in interface Attr
Overrides:
getValue in class org.enhydra.apache.xerces.dom.AttrImpl
See Also:
Attr.getValue()

setValue

public void setValue(String value)
              throws DOMException
Specified by:
setValue in interface Attr
Overrides:
setValue in class org.enhydra.apache.xerces.dom.AttrImpl
See Also:
Attr.setValue(java.lang.String)

getNodeValue

public String getNodeValue()
                    throws DOMException
Specified by:
getNodeValue in interface Node
Overrides:
getNodeValue in class org.enhydra.apache.xerces.dom.AttrImpl
See Also:
Node.getNodeValue()

setNodeValue

public void setNodeValue(String nodeValue)
                  throws DOMException
Specified by:
setNodeValue in interface Node
Overrides:
setNodeValue in class org.enhydra.apache.xerces.dom.AttrImpl
See Also:
Node.setNodeValue(java.lang.String)

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)

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.NodeImpl
See Also:
Node.getParentNode()

getChildNodes

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

getFirstChild

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

getLastChild

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

getPreviousSibling

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

getNextSibling

public Node getNextSibling()
Specified by:
getNextSibling in interface Node
Overrides:
getNextSibling in class org.enhydra.apache.xerces.dom.NodeImpl
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.AttrImpl
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.AttrImpl
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.AttrImpl
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.AttrImpl
See Also:
Node.hasChildNodes()

normalize

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

toString

public String toString()
Return string for debugging. Xerces toString() method calls getValue(), which can cause expansion, so we override.
Overrides:
toString in class org.enhydra.apache.xerces.dom.AttrImpl


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