1 57 58 59 70 71 package com.sun.org.apache.xerces.internal.dom; 72 73 import com.sun.org.apache.xerces.internal.xs.XSTypeDefinition; 74 import org.w3c.dom.NamedNodeMap ; 75 76 81 public class DeferredElementNSImpl 82 extends ElementNSImpl 83 implements DeferredNode { 84 85 89 90 static final long serialVersionUID = -5001885145370927385L; 91 92 96 97 protected transient int fNodeIndex; 98 99 103 107 DeferredElementNSImpl(DeferredDocumentImpl ownerDoc, int nodeIndex) { 108 super(ownerDoc, null); 109 110 fNodeIndex = nodeIndex; 111 needsSyncChildren(true); 112 113 } 115 119 120 public final int getNodeIndex() { 121 return fNodeIndex; 122 } 123 124 128 129 protected final void synchronizeData() { 130 131 needsSyncData(false); 133 134 DeferredDocumentImpl ownerDocument = 136 (DeferredDocumentImpl) this.ownerDocument; 137 138 boolean orig = ownerDocument.mutationEvents; 140 ownerDocument.mutationEvents = false; 141 142 name = ownerDocument.getNodeName(fNodeIndex); 143 144 int index = name.indexOf(':'); 146 if (index < 0) { 147 localName = name; 148 } 149 else { 150 localName = name.substring(index + 1); 151 } 152 153 namespaceURI = ownerDocument.getNodeURI(fNodeIndex); 154 type = ownerDocument.getTypeInfo(fNodeIndex); 155 156 setupDefaultAttributes(); 158 int attrIndex = ownerDocument.getNodeExtra(fNodeIndex); 159 if (attrIndex != -1) { 160 NamedNodeMap attrs = getAttributes(); 161 do { 162 NodeImpl attr = 163 (NodeImpl)ownerDocument.getNodeObject(attrIndex); 164 attrs.setNamedItem(attr); 165 attrIndex = ownerDocument.getPrevSibling(attrIndex); 166 } while (attrIndex != -1); 167 } 168 169 ownerDocument.mutationEvents = orig; 171 172 } 174 180 protected final void synchronizeChildren() { 181 DeferredDocumentImpl ownerDocument = 182 (DeferredDocumentImpl) ownerDocument(); 183 ownerDocument.synchronizeChildren(this, fNodeIndex); 184 } 186 } | Popular Tags |