1 57 58 package com.sun.org.apache.xerces.internal.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, 98 int nodeIndex) { 99 super(ownerDocument, null); 100 101 fNodeIndex = nodeIndex; 102 needsSyncData(true); 103 needsSyncChildren(true); 104 105 } 107 111 112 public int getNodeIndex() { 113 return fNodeIndex; 114 } 115 116 120 121 protected void synchronizeData() { 122 123 needsSyncData(false); 125 126 DeferredDocumentImpl ownerDocument = 128 (DeferredDocumentImpl)this.ownerDocument; 129 name = ownerDocument.getNodeName(fNodeIndex); 130 131 } 133 134 protected void synchronizeChildren() { 135 136 boolean orig = ownerDocument.getMutationEvents(); 138 ownerDocument.setMutationEvents(false); 139 140 needsSyncChildren(false); 142 143 DeferredDocumentImpl ownerDocument = 145 (DeferredDocumentImpl)this.ownerDocument; 146 attributes = new NamedNodeMapImpl(ownerDocument); 147 148 for (int nodeIndex = ownerDocument.getLastChild(fNodeIndex); 151 nodeIndex != -1; 152 nodeIndex = ownerDocument.getPrevSibling(nodeIndex)) { 153 Node attr = ownerDocument.getNodeObject(nodeIndex); 154 attributes.setNamedItem(attr); 155 } 156 157 ownerDocument.setMutationEvents(orig); 159 160 } 162 } | Popular Tags |