1 57 58 63 64 package org.enhydra.apache.xerces.dom; 65 66 import org.enhydra.apache.xerces.utils.StringPool; 67 import org.w3c.dom.NamedNodeMap ; 68 69 89 public class DeferredElementImpl 90 extends ElementImpl 91 implements DeferredNode { 92 93 97 98 static final long serialVersionUID = -7670981133940934842L; 99 100 104 105 protected transient int fNodeIndex; 106 107 111 115 DeferredElementImpl(DeferredDocumentImpl ownerDoc, int nodeIndex) { 116 super(ownerDoc, null); 117 118 fNodeIndex = nodeIndex; 119 needsSyncChildren(true); 120 121 } 123 127 128 public final int getNodeIndex() { 129 return fNodeIndex; 130 } 131 132 136 137 protected final void synchronizeData() { 138 139 needsSyncData(false); 141 142 DeferredDocumentImpl ownerDocument = 144 (DeferredDocumentImpl)this.ownerDocument; 145 146 boolean orig = ownerDocument.mutationEvents; 148 ownerDocument.mutationEvents = false; 149 150 int elementTypeName = ownerDocument.getNodeName(fNodeIndex); 151 StringPool pool = ownerDocument.getStringPool(); 152 name = pool.toString(elementTypeName); 153 154 setupDefaultAttributes(); 156 int index = ownerDocument.getNodeValue(fNodeIndex); 157 if (index != -1) { 158 NamedNodeMap attrs = getAttributes(); 159 do { 160 NodeImpl attr = (NodeImpl)ownerDocument.getNodeObject(index); 161 attrs.setNamedItem(attr); 162 index = ownerDocument.getPrevSibling(index); 163 } while (index != -1); 164 } 165 166 ownerDocument.mutationEvents = orig; 168 169 } 171 protected final void synchronizeChildren() { 172 DeferredDocumentImpl ownerDocument = 173 (DeferredDocumentImpl) ownerDocument(); 174 ownerDocument.synchronizeChildren(this, fNodeIndex); 175 } 177 } | Popular Tags |