1 16 17 18 25 26 package org.apache.xerces.dom; 27 28 import org.apache.xerces.xs.XSTypeDefinition; 29 import org.w3c.dom.NamedNodeMap ; 30 31 39 public class DeferredElementNSImpl 40 extends ElementNSImpl 41 implements DeferredNode { 42 43 47 48 static final long serialVersionUID = -5001885145370927385L; 49 50 54 55 protected transient int fNodeIndex; 56 57 61 65 DeferredElementNSImpl(DeferredDocumentImpl ownerDoc, int nodeIndex) { 66 super(ownerDoc, null); 67 68 fNodeIndex = nodeIndex; 69 needsSyncChildren(true); 70 71 } 73 77 78 public final int getNodeIndex() { 79 return fNodeIndex; 80 } 81 82 86 87 protected final void synchronizeData() { 88 89 needsSyncData(false); 91 92 DeferredDocumentImpl ownerDocument = 94 (DeferredDocumentImpl) this.ownerDocument; 95 96 boolean orig = ownerDocument.mutationEvents; 98 ownerDocument.mutationEvents = false; 99 100 name = ownerDocument.getNodeName(fNodeIndex); 101 102 int index = name.indexOf(':'); 104 if (index < 0) { 105 localName = name; 106 } 107 else { 108 localName = name.substring(index + 1); 109 } 110 111 namespaceURI = ownerDocument.getNodeURI(fNodeIndex); 112 type = (XSTypeDefinition)ownerDocument.getTypeInfo(fNodeIndex); 113 114 setupDefaultAttributes(); 116 int attrIndex = ownerDocument.getNodeExtra(fNodeIndex); 117 if (attrIndex != -1) { 118 NamedNodeMap attrs = getAttributes(); 119 do { 120 NodeImpl attr = 121 (NodeImpl)ownerDocument.getNodeObject(attrIndex); 122 attrs.setNamedItem(attr); 123 attrIndex = ownerDocument.getPrevSibling(attrIndex); 124 } while (attrIndex != -1); 125 } 126 127 ownerDocument.mutationEvents = orig; 129 130 } 132 138 protected final void synchronizeChildren() { 139 DeferredDocumentImpl ownerDocument = 140 (DeferredDocumentImpl) ownerDocument(); 141 ownerDocument.synchronizeChildren(this, fNodeIndex); 142 } 144 } | Popular Tags |