1 16 17 package org.apache.xerces.dom; 18 19 import org.w3c.dom.Node ; 20 21 32 public class DeferredElementDefinitionImpl 33 extends ElementDefinitionImpl 34 implements DeferredNode { 35 36 40 41 static final long serialVersionUID = 6703238199538041591L; 42 43 47 48 protected transient int fNodeIndex; 49 50 54 58 DeferredElementDefinitionImpl(DeferredDocumentImpl ownerDocument, 59 int nodeIndex) { 60 super(ownerDocument, null); 61 62 fNodeIndex = nodeIndex; 63 needsSyncData(true); 64 needsSyncChildren(true); 65 66 } 68 72 73 public int getNodeIndex() { 74 return fNodeIndex; 75 } 76 77 81 82 protected void synchronizeData() { 83 84 needsSyncData(false); 86 87 DeferredDocumentImpl ownerDocument = 89 (DeferredDocumentImpl)this.ownerDocument; 90 name = ownerDocument.getNodeName(fNodeIndex); 91 92 } 94 95 protected void synchronizeChildren() { 96 97 boolean orig = ownerDocument.getMutationEvents(); 99 ownerDocument.setMutationEvents(false); 100 101 needsSyncChildren(false); 103 104 DeferredDocumentImpl ownerDocument = 106 (DeferredDocumentImpl)this.ownerDocument; 107 attributes = new NamedNodeMapImpl(ownerDocument); 108 109 for (int nodeIndex = ownerDocument.getLastChild(fNodeIndex); 112 nodeIndex != -1; 113 nodeIndex = ownerDocument.getPrevSibling(nodeIndex)) { 114 Node attr = ownerDocument.getNodeObject(nodeIndex); 115 attributes.setNamedItem(attr); 116 } 117 118 ownerDocument.setMutationEvents(orig); 120 121 } 123 } | Popular Tags |