com.sun.org.apache.xerces.internal.dom
public class: DeferredElementDefinitionImpl [javadoc |
source]
java.lang.Object
com.sun.org.apache.xerces.internal.dom.NodeImpl
com.sun.org.apache.xerces.internal.dom.ChildNode
com.sun.org.apache.xerces.internal.dom.ParentNode
com.sun.org.apache.xerces.internal.dom.ElementDefinitionImpl
com.sun.org.apache.xerces.internal.dom.DeferredElementDefinitionImpl
All Implemented Interfaces:
DeferredNode, Cloneable, Node, EventTarget, Serializable, NodeList
NON-DOM CLASS: Describe one of the Elements (and its associated
Attributes) defined in this Document Type.
I've included this in Level 1 purely as an anchor point for default
attributes. In Level 2 it should enable the ChildRule support.
| Field Summary |
|---|
| static final long | serialVersionUID | Serialization version. |
| protected transient int | fNodeIndex | Node index. |
| Fields inherited from com.sun.org.apache.xerces.internal.dom.NodeImpl: |
|---|
| TREE_POSITION_PRECEDING, TREE_POSITION_FOLLOWING, TREE_POSITION_ANCESTOR, TREE_POSITION_DESCENDANT, TREE_POSITION_EQUIVALENT, TREE_POSITION_SAME_NODE, TREE_POSITION_DISCONNECTED, DOCUMENT_POSITION_DISCONNECTED, DOCUMENT_POSITION_PRECEDING, DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_IS_CONTAINED, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, serialVersionUID, ELEMENT_DEFINITION_NODE, ownerNode, flags, READONLY, SYNCDATA, SYNCCHILDREN, OWNED, FIRSTCHILD, SPECIFIED, IGNORABLEWS, HASSTRING, NORMALIZED, ID |
| Constructor: |
DeferredElementDefinitionImpl(DeferredDocumentImpl ownerDocument,
int nodeIndex) {
//
// Constructors
//
super(ownerDocument, null);
fNodeIndex = nodeIndex;
needsSyncData(true);
needsSyncChildren(true);
}
This is the deferred constructor. Only the fNodeIndex is given here.
All other data, can be requested from the ownerDocument via the index. |
| Methods from com.sun.org.apache.xerces.internal.dom.ParentNode: |
|---|
|
checkNormalizationAfterInsert, checkNormalizationAfterRemove, cloneNode, getChildNodes, getChildNodesUnoptimized, getFirstChild, getLastChild, getLength, getOwnerDocument, getTextContent, getTextContent, hasChildNodes, hasTextContent, insertBefore, internalInsertBefore, internalRemoveChild, isEqualNode, item, lastChild, lastChild, normalize, ownerDocument, removeChild, replaceChild, setOwnerDocument, setReadOnly, setTextContent, synchronizeChildren |
| Methods from com.sun.org.apache.xerces.internal.dom.NodeImpl: |
|---|
|
addEventListener, appendChild, changed, changes, cloneNode, compareDocumentPosition, compareTreePosition, dispatchEvent, getAttributes, getBaseURI, getChildNodes, getContainer, getElementAncestor, getFeature, getFirstChild, getLastChild, getLength, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getNodeNumber, getNodeType, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, getReadOnly, getTextContent, getTextContent, getUserData, getUserData, getUserDataRecord, hasAttributes, hasChildNodes, hasStringValue, hasStringValue, insertBefore, internalIsIgnorableWhitespace, isDefaultNamespace, isEqualNode, isFirstChild, isFirstChild, isIdAttribute, isIdAttribute, isIgnorableWhitespace, isNormalized, isNormalized, isOwned, isOwned, isReadOnly, isReadOnly, isSameNode, isSpecified, isSpecified, isSupported, item, lookupNamespacePrefix, lookupNamespaceURI, lookupPrefix, needsSyncChildren, needsSyncChildren, needsSyncData, needsSyncData, normalize, ownerDocument, parentNode, previousSibling, removeChild, removeEventListener, replaceChild, setNodeValue, setOwnerDocument, setPrefix, setReadOnly, setTextContent, setUserData, setUserData, synchronizeData, toString |
| Method from com.sun.org.apache.xerces.internal.dom.DeferredElementDefinitionImpl Detail: |
public int getNodeIndex() {
return fNodeIndex;
}
|
protected void synchronizeChildren() {
// we don't want to generate any event for this so turn them off
boolean orig = ownerDocument.getMutationEvents();
ownerDocument.setMutationEvents(false);
// attributes are now synced
needsSyncChildren(false);
// create attributes node map
DeferredDocumentImpl ownerDocument =
(DeferredDocumentImpl)this.ownerDocument;
attributes = new NamedNodeMapImpl(ownerDocument);
// Default attributes dangle as children of the element
// definition "node" in the internal fast table.
for (int nodeIndex = ownerDocument.getLastChild(fNodeIndex);
nodeIndex != -1;
nodeIndex = ownerDocument.getPrevSibling(nodeIndex)) {
Node attr = ownerDocument.getNodeObject(nodeIndex);
attributes.setNamedItem(attr);
}
// set mutation events flag back to its original value
ownerDocument.setMutationEvents(orig);
}
Synchronizes the default attribute values. |
protected void synchronizeData() {
// no need to sync in the future
needsSyncData(false);
// fluff data
DeferredDocumentImpl ownerDocument =
(DeferredDocumentImpl)this.ownerDocument;
name = ownerDocument.getNodeName(fNodeIndex);
}
Synchronizes the data (name and value) for fast nodes. |