/** * Returns the extra info of the given node. * Used by AttrImpl to store specified value (1 == true). */ public int getNodeExtra(int nodeIndex) { return getNodeExtra(nodeIndex, true); }
public String getDeferredEntityBaseURI (int entityIndex){ if (entityIndex != -1) { int extraDataIndex = getNodeExtra(entityIndex, false); extraDataIndex = getNodeExtra(extraDataIndex, false); return getNodeName (extraDataIndex, false); } return null; }
/** * DOM Internal * * An attribute specifying the actual encoding of this document. This is * <code>null</code> otherwise. * <br> This attribute represents the property [character encoding scheme] * defined in . */ public void setInputEncoding(int currentEntityDecl, String value){ // get first extra data chunk int nodeIndex = getNodeExtra(currentEntityDecl, false); // get second extra data chunk int extraDataIndex = getNodeExtra(nodeIndex, false); int echunk = extraDataIndex >> CHUNK_SHIFT; int eindex = extraDataIndex & CHUNK_MASK; setChunkValue(fNodeValue, value, echunk, eindex); }
public void setEntityInfo(int currentEntityDecl, String version, String encoding){ int eNodeIndex = getNodeExtra(currentEntityDecl, false); if (eNodeIndex !=-1) { int echunk = eNodeIndex >> CHUNK_SHIFT; int eindex = eNodeIndex & CHUNK_MASK; setChunkValue(fNodeValue, version, echunk, eindex); setChunkValue(fNodeURI, encoding, echunk, eindex); } }
/** * Returns internal Xerces details about all elements in the specified document. * The id of the returned {@link Map} is the {@code nodeIndex} of an element, and the list * is the array of ordered attributes names. * @param document the document * @return the map of an element index with its ordered attribute names */ public static Map<Integer, List<String>> getAttributesOrderMap(final Document document) { final Map<Integer, List<String>> map = new HashMap<>(); if (document instanceof DeferredDocumentImpl) { final DeferredDocumentImpl deferredDocument = (DeferredDocumentImpl) document; final int fNodeCount = getPrivate(deferredDocument, "fNodeCount"); for (int i = 0; i < fNodeCount; i++) { final int type = deferredDocument.getNodeType(i, false); if (type == org.w3c.dom.Node.ELEMENT_NODE) { int attrIndex = deferredDocument.getNodeExtra(i, false); final List<String> attributes = new ArrayList<>(); map.put(i, attributes); while (attrIndex != -1) { attributes.add(deferredDocument.getNodeName(attrIndex, false)); attrIndex = deferredDocument.getPrevSibling(attrIndex, false); } } } } return map; }
/** * Returns internal Xerces details about all elements in the specified document. * The id of the returned {@link Map} is the {@code nodeIndex} of an element, and the list * is the array of ordered attributes names. * @param document the document * @return the map of an element index with its ordered attribute names */ public static Map<Integer, List<String>> getAttributesOrderMap(final Document document) { final Map<Integer, List<String>> map = new HashMap<>(); if (document instanceof DeferredDocumentImpl) { final DeferredDocumentImpl deferredDocument = (DeferredDocumentImpl) document; final int fNodeCount = getPrivate(deferredDocument, "fNodeCount"); for (int i = 0; i < fNodeCount; i++) { final int type = deferredDocument.getNodeType(i, false); if (type == Node.ELEMENT_NODE) { int attrIndex = deferredDocument.getNodeExtra(i, false); final List<String> attributes = new ArrayList<>(); map.put(i, attributes); while (attrIndex != -1) { attributes.add(deferredDocument.getNodeName(attrIndex, false)); attrIndex = deferredDocument.getPrevSibling(attrIndex, false); } } } } return map; }
/** Synchronizes the underlying data. */ protected void synchronizeData() { // no need for future synchronizations needsSyncData(false); // get initial text value DeferredDocumentImpl ownerDocument = (DeferredDocumentImpl) this.ownerDocument(); data = ownerDocument.getNodeValueString(fNodeIndex); // NOTE: We used to normalize adjacent text node values here. // This code has moved to the DeferredDocumentImpl // getNodeValueString() method. -Ac // ignorable whitespace isIgnorableWhitespace(ownerDocument.getNodeExtra(fNodeIndex) == 1); } // synchronizeData()
/** Synchronizes the data (name and value) for fast nodes. */ protected void synchronizeData() { // no need to sync in the future needsSyncData(false); // fluff data DeferredDocumentImpl ownerDocument = (DeferredDocumentImpl)this.ownerDocument; name = ownerDocument.getNodeName(fNodeIndex); // public and system ids publicID = ownerDocument.getNodeValue(fNodeIndex); systemID = ownerDocument.getNodeURI(fNodeIndex); int extraDataIndex = ownerDocument.getNodeExtra(fNodeIndex); internalSubset = ownerDocument.getNodeValue(extraDataIndex); } // synchronizeData()
/** Synchronizes the data (name and value) for fast nodes. */ protected void synchronizeData() { // no need to sync in the future needsSyncData(false); // fluff data DeferredDocumentImpl ownerDocument = (DeferredDocumentImpl) ownerDocument(); name = ownerDocument.getNodeName(fNodeIndex); // extract prefix and local part from QName int index = name.indexOf(':'); if (index < 0) { localName = name; } else { localName = name.substring(index + 1); } int extra = ownerDocument.getNodeExtra(fNodeIndex); isSpecified((extra & SPECIFIED) != 0); isIdAttribute((extra & ID) != 0); namespaceURI = ownerDocument.getNodeURI(fNodeIndex); int extraNode = ownerDocument.getLastChild(fNodeIndex); type = ownerDocument.getTypeInfo(extraNode); } // synchronizeData()
/** * Synchronize the entity data. This is special because of the way * that the "fast" version stores the information. */ protected void synchronizeData() { // no need to sychronize again needsSyncData(false); // get the node data DeferredDocumentImpl ownerDocument = (DeferredDocumentImpl)this.ownerDocument; name = ownerDocument.getNodeName(fNodeIndex); // get the entity data publicId = ownerDocument.getNodeValue(fNodeIndex); systemId = ownerDocument.getNodeURI(fNodeIndex); int extraDataIndex = ownerDocument.getNodeExtra(fNodeIndex); ownerDocument.getNodeType(extraDataIndex); notationName = ownerDocument.getNodeName(extraDataIndex); // encoding and version DOM L3 version = ownerDocument.getNodeValue(extraDataIndex); encoding = ownerDocument.getNodeURI(extraDataIndex); // baseURI, actualEncoding DOM L3 int extraIndex2 = ownerDocument.getNodeExtra(extraDataIndex); baseURI = ownerDocument.getNodeName(extraIndex2); inputEncoding = ownerDocument.getNodeValue(extraIndex2); } // synchronizeData()
/** Synchronizes the data (name and value) for fast nodes. */ protected void synchronizeData() { // no need to sync in the future needsSyncData(false); // fluff data DeferredDocumentImpl ownerDocument = (DeferredDocumentImpl) ownerDocument(); name = ownerDocument.getNodeName(fNodeIndex); int extra = ownerDocument.getNodeExtra(fNodeIndex); isSpecified((extra & SPECIFIED) != 0); isIdAttribute((extra & ID) != 0); int extraNode = ownerDocument.getLastChild(fNodeIndex); type = ownerDocument.getTypeInfo(extraNode); } // synchronizeData()
/** * Synchronizes the data. This is special because of the way * that the "fast" notation stores its information internally. */ protected void synchronizeData() { // no need to synchronize again needsSyncData(false); // name DeferredDocumentImpl ownerDocument = (DeferredDocumentImpl)this.ownerDocument(); name = ownerDocument.getNodeName(fNodeIndex); ownerDocument.getNodeType(fNodeIndex); // public and system ids publicId = ownerDocument.getNodeValue(fNodeIndex); systemId = ownerDocument.getNodeURI(fNodeIndex); int extraDataIndex = ownerDocument.getNodeExtra(fNodeIndex); ownerDocument.getNodeType(extraDataIndex); baseURI = ownerDocument.getNodeName(extraDataIndex); } // synchronizeData()
/** Synchronizes the data (name and value) for fast nodes. */ protected final void synchronizeData() { // no need to sync in the future needsSyncData(false); // fluff data DeferredDocumentImpl ownerDocument = (DeferredDocumentImpl)this.ownerDocument; // we don't want to generate any event for this so turn them off boolean orig = ownerDocument.mutationEvents; ownerDocument.mutationEvents = false; name = ownerDocument.getNodeName(fNodeIndex); // attributes setupDefaultAttributes(); int index = ownerDocument.getNodeExtra(fNodeIndex); if (index != -1) { NamedNodeMap attrs = getAttributes(); do { NodeImpl attr = (NodeImpl)ownerDocument.getNodeObject(index); attrs.setNamedItem(attr); index = ownerDocument.getPrevSibling(index); } while (index != -1); } // set mutation events flag back to its original value ownerDocument.mutationEvents = orig; } // synchronizeData()
int attrIndex = ownerDocument.getNodeExtra(fNodeIndex); if (attrIndex != -1) { NamedNodeMap attrs = getAttributes();