DeferredElementNSImplpublic class DeferredElementNSImpl extends ElementNSImpl implements DeferredNodeDeferredElementNSImpl is to ElementNSImpl, what DeferredElementImpl is to
ElementImpl. |
Fields Summary |
---|
static final long | serialVersionUIDSerialization version. | protected transient int | fNodeIndexNode index. |
Constructors Summary |
---|
DeferredElementNSImpl(DeferredDocumentImpl ownerDoc, int nodeIndex)This is the deferred constructor. Only the fNodeIndex is given here. All
other data, can be requested from the ownerDocument via the index.
//
// Constructors
//
super(ownerDoc, null);
fNodeIndex = nodeIndex;
needsSyncChildren(true);
|
Methods Summary |
---|
public final int | getNodeIndex()Returns the node index.
return fNodeIndex;
| protected final void | synchronizeChildren()Synchronizes the node's children with the internal structure.
Fluffing the children at once solves a lot of work to keep
the two structures in sync. The problem gets worse when
editing the tree -- this makes it a lot easier.
DeferredDocumentImpl ownerDocument =
(DeferredDocumentImpl) ownerDocument();
ownerDocument.synchronizeChildren(this, fNodeIndex);
| protected final void | synchronizeData()Synchronizes the data (name and value) for fast nodes.
// no need to sync in the future
needsSyncData(false);
// fluff data
DeferredDocumentImpl ownerDocument =
(DeferredDocumentImpl) this.ownerDocument;
// we don't want to generate any event for this so turn them off
boolean orig = ownerDocument.mutationEvents;
ownerDocument.mutationEvents = false;
name = ownerDocument.getNodeName(fNodeIndex);
// extract local part from QName
int index = name.indexOf(':");
if (index < 0) {
localName = name;
}
else {
localName = name.substring(index + 1);
}
namespaceURI = ownerDocument.getNodeURI(fNodeIndex);
type = (XSTypeDefinition)ownerDocument.getTypeInfo(fNodeIndex);
// attributes
setupDefaultAttributes();
int attrIndex = ownerDocument.getNodeExtra(fNodeIndex);
if (attrIndex != -1) {
NamedNodeMap attrs = getAttributes();
do {
NodeImpl attr =
(NodeImpl)ownerDocument.getNodeObject(attrIndex);
attrs.setNamedItem(attr);
attrIndex = ownerDocument.getPrevSibling(attrIndex);
} while (attrIndex != -1);
}
// set mutation events flag back to its original value
ownerDocument.mutationEvents = orig;
|
|