1 57 58 package org.enhydra.apache.xerces.dom; 59 60 import org.w3c.dom.Node ; 61 62 71 public class DeferredElementDefinitionImpl 72 extends ElementDefinitionImpl 73 implements DeferredNode { 74 75 79 80 static final long serialVersionUID = 6703238199538041591L; 81 82 86 87 protected transient int fNodeIndex; 88 89 93 97 DeferredElementDefinitionImpl(DeferredDocumentImpl ownerDocument, int nodeIndex) { 98 super(ownerDocument, null); 99 100 fNodeIndex = nodeIndex; 101 needsSyncData(true); 102 needsSyncChildren(true); 103 104 } 106 110 111 public int getNodeIndex() { 112 return fNodeIndex; 113 } 114 115 119 120 protected void synchronizeData() { 121 122 needsSyncData(false); 124 125 DeferredDocumentImpl ownerDocument = 127 (DeferredDocumentImpl)this.ownerDocument; 128 name = ownerDocument.getNodeNameString(fNodeIndex); 129 130 } 132 133 protected void synchronizeChildren() { 134 135 boolean orig = ownerDocument.getMutationEvents(); 137 ownerDocument.setMutationEvents(false); 138 139 needsSyncChildren(false); 141 142 DeferredDocumentImpl ownerDocument = 144 (DeferredDocumentImpl)this.ownerDocument; 145 attributes = new NamedNodeMapImpl(ownerDocument); 146 147 for (int nodeIndex = ownerDocument.getLastChild(fNodeIndex); 150 nodeIndex != -1; 151 nodeIndex = ownerDocument.getPrevSibling(nodeIndex)) { 152 Node attr = ownerDocument.getNodeObject(nodeIndex); 153 attributes.setNamedItem(attr); 154 } 155 156 ownerDocument.setMutationEvents(orig); 158 159 } 161 } | Popular Tags |