public class DeferredDocumentImpl extends DocumentImpl implements DeferredNode
Since elements, text nodes, comments, processing instructions, etc. cannot exist outside the context of a Document, the Document interface also contains the factory methods needed to create these objects. The Node objects created have a ownerDocument attribute which associates them with the Document within whose context they were created.
Modifier and Type | Field and Description |
---|---|
protected static int |
CHUNK_MASK
Chunk mask.
|
protected static int |
CHUNK_SHIFT
Chunk shift.
|
protected static int |
CHUNK_SIZE
Chunk size.
|
protected int |
fIdCount
Identifier count.
|
protected int[] |
fIdElement
Identifier element indexes.
|
protected String[] |
fIdName
Identifier name indexes.
|
protected boolean |
fNamespacesEnabled
DOM2: For namespace support in the deferred case.
|
protected int |
fNodeCount
Node count.
|
protected int[][] |
fNodeExtra
Extra data.
|
protected int[][] |
fNodeLastChild
Node first children.
|
protected Object[][] |
fNodeName
Node names.
|
protected int[][] |
fNodeParent
Node parents.
|
protected int[][] |
fNodePrevSib
Node prev siblings.
|
protected int[][] |
fNodeType
Node types.
|
protected Object[][] |
fNodeURI
Node namespace URI.
|
protected Object[][] |
fNodeValue
Node values.
|
protected static int |
INITIAL_CHUNK_COUNT
Initial chunk size.
|
eventListeners, iterators, mutationEvents, ranges
actualEncoding, allowGrammarAccess, changes, docElement, docType, encoding, errorChecking, fDocumentURI, identifiers, standalone, userData, version, xmlVersionChanged
firstChild, fNodeListCache, ownerDocument
nextSibling, previousSibling
DOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_DISCONNECTED, DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, DOCUMENT_POSITION_IS_CONTAINED, DOCUMENT_POSITION_PRECEDING, ELEMENT_DEFINITION_NODE, FIRSTCHILD, flags, HASSTRING, ID, IGNORABLEWS, NORMALIZED, OWNED, ownerNode, READONLY, SPECIFIED, SYNCCHILDREN, SYNCDATA, TREE_POSITION_ANCESTOR, TREE_POSITION_DESCENDANT, TREE_POSITION_DISCONNECTED, TREE_POSITION_EQUIVALENT, TREE_POSITION_FOLLOWING, TREE_POSITION_PRECEDING, TREE_POSITION_SAME_NODE
TYPE_NODE
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_POSITION_CONTAINED_BY, DOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_DISCONNECTED, DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, DOCUMENT_POSITION_PRECEDING, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE
Constructor and Description |
---|
DeferredDocumentImpl()
NON-DOM: Actually creating a Document is outside the DOM's spec,
since it has to operate in terms of a particular implementation.
|
DeferredDocumentImpl(boolean namespacesEnabled)
NON-DOM: Actually creating a Document is outside the DOM's spec,
since it has to operate in terms of a particular implementation.
|
DeferredDocumentImpl(boolean namespaces,
boolean grammarAccess)
Experimental constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
appendChild(int parentIndex,
int childIndex)
Appends a child to the specified parent in the table.
|
protected static int |
binarySearch(int[] values,
int start,
int end,
int target)
Performs a binary search for a target value in an array of
values.
|
int |
cloneNode(int nodeIndex,
boolean deep)
Creates a clone of the specified node.
|
int |
createDeferredAttribute(String attrName,
String attrValue,
boolean specified)
Creates an attribute in the table.
|
int |
createDeferredAttribute(String attrName,
String attrURI,
String attrValue,
boolean specified)
Creates an attribute with a URI in the table.
|
int |
createDeferredCDATASection(String data)
Creates a CDATA section node in the table.
|
int |
createDeferredComment(String data)
Creates a comment node in the table.
|
int |
createDeferredDocument()
Creates a document node in the table.
|
int |
createDeferredDocumentType(String rootElementName,
String publicId,
String systemId)
Creates a doctype.
|
int |
createDeferredElement(String elementName)
Deprecated.
|
int |
createDeferredElement(String elementURI,
String elementName)
Creates an element node with a URI in the table.
|
int |
createDeferredElement(String elementURI,
String elementName,
Object type)
Deprecated.
|
int |
createDeferredElementDefinition(String elementName)
Creates an element definition in the table.
|
int |
createDeferredEntity(String entityName,
String publicId,
String systemId,
String notationName,
String baseURI)
Creates an entity in the table.
|
int |
createDeferredEntityReference(String name,
String baseURI)
Creates an entity reference node in the table.
|
int |
createDeferredNotation(String notationName,
String publicId,
String systemId,
String baseURI)
Creates a notation in the table.
|
int |
createDeferredProcessingInstruction(String target,
String data)
Creates a processing instruction node in the table.
|
int |
createDeferredTextNode(String data,
boolean ignorableWhitespace)
Creates a text node in the table.
|
protected int |
createNode(short nodeType)
Creates a node of the specified type.
|
protected void |
ensureCapacity(int chunk)
Ensures that the internal tables are large enough.
|
String |
getAttribute(int elemIndex,
String name)
Returns the attribute value of the given name.
|
String |
getDeferredEntityBaseURI(int entityIndex) |
DOMImplementation |
getImplementation()
Retrieve information describing the abilities of this particular
DOM implementation.
|
int |
getLastChild(int nodeIndex)
Returns the last child of the given node.
|
int |
getLastChild(int nodeIndex,
boolean free)
Returns the last child of the given node.
|
int |
getNodeExtra(int nodeIndex)
Returns the extra info of the given node.
|
int |
getNodeExtra(int nodeIndex,
boolean free)
Returns the extra info of the given node.
|
int |
getNodeIndex()
Returns the node index.
|
String |
getNodeName(int nodeIndex)
Returns the name of the given node.
|
String |
getNodeName(int nodeIndex,
boolean free)
Returns the name of the given node.
|
DeferredNode |
getNodeObject(int nodeIndex)
Instantiates the requested node object.
|
short |
getNodeType(int nodeIndex)
Returns the type of the given node.
|
short |
getNodeType(int nodeIndex,
boolean free)
Returns the type of the given node.
|
String |
getNodeURI(int nodeIndex)
Returns the URI of the given node.
|
String |
getNodeURI(int nodeIndex,
boolean free)
Returns the URI of the given node.
|
String |
getNodeValue(int nodeIndex)
Returns the value of the given node.
|
String |
getNodeValue(int nodeIndex,
boolean free)
Returns the value of the given node.
|
String |
getNodeValueString(int nodeIndex)
Returns the real value of the given node.
|
String |
getNodeValueString(int nodeIndex,
boolean free)
Returns the real value of the given node.
|
int |
getParentNode(int nodeIndex)
Returns the parent node of the given node.
|
int |
getParentNode(int nodeIndex,
boolean free)
Returns the parent node of the given node.
|
int |
getPrevSibling(int nodeIndex)
Returns the prev sibling of the given node.
|
int |
getPrevSibling(int nodeIndex,
boolean free)
Returns the prev sibling of the given node.
|
int |
getRealPrevSibling(int nodeIndex)
Returns the real prev sibling of the given node,
directly from the data structures.
|
int |
getRealPrevSibling(int nodeIndex,
boolean free)
Returns the real prev sibling of the given node.
|
Object |
getTypeInfo(int nodeIndex)
Clears the type info that is stored in the fNodeValue array
|
int |
insertBefore(int parentIndex,
int newChildIndex,
int refChildIndex)
Inserts a child before the specified node in the table.
|
int |
lookupElementDefinition(String elementName)
Returns the index of the element definition in the table
with the specified name index, or -1 if no such definition
exists.
|
void |
print()
Prints out the tables.
|
void |
putIdentifier(String name,
int elementNodeIndex)
Registers an identifier name with a specified element node.
|
void |
setAsLastChild(int parentIndex,
int childIndex)
Sets the last child of the parentIndex to childIndex.
|
int |
setAttributeNode(int elemIndex,
int attrIndex)
Adds an attribute node to the specified element.
|
int |
setDeferredAttribute(int elementNodeIndex,
String attrName,
String attrURI,
String attrValue,
boolean specified)
Deprecated.
|
int |
setDeferredAttribute(int elementNodeIndex,
String attrName,
String attrURI,
String attrValue,
boolean specified,
boolean id,
Object type)
This method is used by the DOMParser to create attributes.
|
void |
setEntityInfo(int currentEntityDecl,
String version,
String encoding) |
void |
setIdAttribute(int attrIndex)
Sets type of attribute
|
void |
setIdAttributeNode(int elemIndex,
int attrIndex)
Adds an attribute node to the specified element.
|
void |
setInputEncoding(int currentEntityDecl,
String value)
DOM Internal
An attribute specifying the actual encoding of this document.
|
void |
setInternalSubset(int doctypeIndex,
String subset) |
void |
setTypeInfo(int elementNodeIndex,
Object type) |
protected void |
synchronizeChildren()
Synchronizes the node's children with the internal structure.
|
protected void |
synchronizeChildren(AttrImpl a,
int nodeIndex)
Synchronizes the node's children with the internal structure.
|
protected void |
synchronizeChildren(ParentNode p,
int nodeIndex)
Synchronizes the node's children with the internal structure.
|
protected void |
synchronizeData()
Synchronizes the node's data.
|
addEventListener, cloneNode, copyEventListeners, createEvent, createNodeIterator, createNodeIterator, createRange, createTreeWalker, createTreeWalker, dispatchAggregateEvents, dispatchAggregateEvents, dispatchEvent, dispatchEventToSubtree, dispatchingEventToSubtree, getEventListeners, removeEventListener, saveEnclosingAttr, setEventListeners
abort, adoptNode, callUserDataHandlers, changed, changes, checkDOMNSErr, checkNamespaceWF, checkQName, clearIdentifiers, clone, cloneNode, createAttribute, createAttributeNS, createAttributeNS, createCDATASection, createComment, createDocumentFragment, createDocumentType, createElement, createElementDefinition, createElementNS, createElementNS, createEntity, createEntityReference, createNotation, createProcessingInstruction, createTextNode, getAsync, getBaseURI, getDoctype, getDocumentElement, getDocumentURI, getDomConfig, getElementById, getElementsByTagName, getElementsByTagNameNS, getEncoding, getErrorChecking, getFeature, getIdentifier, getIdentifiers, getInputEncoding, getNodeName, getNodeNumber, getNodeNumber, getNodeType, getOwnerDocument, getStandalone, getStrictErrorChecking, getTextContent, getUserData, getUserData, getUserDataRecord, getVersion, getXmlEncoding, getXmlStandalone, getXmlVersion, importNode, insertBefore, isKidOK, isValidQName, isXMLName, load, loadXML, normalizeDocument, putIdentifier, removeChild, removeIdentifier, renameNode, replaceChild, saveXML, setAsync, setDocumentURI, setEncoding, setErrorChecking, setInputEncoding, setStandalone, setStrictErrorChecking, setTextContent, setUserData, setUserData, setVersion, setXmlEncoding, setXmlStandalone, setXmlVersion, undeferChildren
getChildNodes, getChildNodesUnoptimized, getFirstChild, getLastChild, getLength, hasChildNodes, isEqualNode, item, normalize, setOwnerDocument, setReadOnly
getNextSibling, getParentNode, getPreviousSibling
addEventListener, appendChild, compareDocumentPosition, compareTreePosition, dispatchEvent, getAttributes, getContainer, getLocalName, getNamespaceURI, getNodeValue, getPrefix, getReadOnly, getUserData, getUserData, getUserDataRecord, hasAttributes, isDefaultNamespace, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, needsSyncChildren, removeEventListener, setNodeValue, setPrefix, setUserData, setUserData, toString
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
appendChild, cloneNode, compareDocumentPosition, getAttributes, getBaseURI, getChildNodes, getFeature, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, getTextContent, getUserData, hasAttributes, hasChildNodes, insertBefore, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, removeChild, replaceChild, setNodeValue, setPrefix, setTextContent, setUserData
protected static final int CHUNK_SHIFT
protected static final int CHUNK_SIZE
protected static final int CHUNK_MASK
protected static final int INITIAL_CHUNK_COUNT
protected transient int fNodeCount
protected transient int[][] fNodeType
protected transient Object[][] fNodeName
protected transient Object[][] fNodeValue
protected transient int[][] fNodeParent
protected transient int[][] fNodeLastChild
protected transient int[][] fNodePrevSib
protected transient Object[][] fNodeURI
protected transient int[][] fNodeExtra
protected transient int fIdCount
protected transient String[] fIdName
protected transient int[] fIdElement
protected boolean fNamespacesEnabled
public DeferredDocumentImpl()
public DeferredDocumentImpl(boolean namespacesEnabled)
public DeferredDocumentImpl(boolean namespaces, boolean grammarAccess)
public DOMImplementation getImplementation()
getImplementation
in interface Document
getImplementation
in class DocumentImpl
public int createDeferredDocument()
public int createDeferredDocumentType(String rootElementName, String publicId, String systemId)
public void setInternalSubset(int doctypeIndex, String subset)
public int createDeferredNotation(String notationName, String publicId, String systemId, String baseURI)
public int createDeferredEntity(String entityName, String publicId, String systemId, String notationName, String baseURI)
public String getDeferredEntityBaseURI(int entityIndex)
public void setTypeInfo(int elementNodeIndex, Object type)
public void setInputEncoding(int currentEntityDecl, String value)
null
otherwise.
public int createDeferredEntityReference(String name, String baseURI)
public int createDeferredElement(String elementURI, String elementName, Object type)
public int createDeferredElement(String elementName)
public int createDeferredElement(String elementURI, String elementName)
public int setDeferredAttribute(int elementNodeIndex, String attrName, String attrURI, String attrValue, boolean specified, boolean id, Object type)
elementNodeIndex
- attrName
- attrURI
- attrValue
- specified
- id
- type
- public int setDeferredAttribute(int elementNodeIndex, String attrName, String attrURI, String attrValue, boolean specified)
public int createDeferredAttribute(String attrName, String attrValue, boolean specified)
public int createDeferredAttribute(String attrName, String attrURI, String attrValue, boolean specified)
public int createDeferredElementDefinition(String elementName)
public int createDeferredTextNode(String data, boolean ignorableWhitespace)
public int createDeferredCDATASection(String data)
public int createDeferredProcessingInstruction(String target, String data)
public int createDeferredComment(String data)
public int cloneNode(int nodeIndex, boolean deep)
public void appendChild(int parentIndex, int childIndex)
public int setAttributeNode(int elemIndex, int attrIndex)
public void setIdAttributeNode(int elemIndex, int attrIndex)
public void setIdAttribute(int attrIndex)
public int insertBefore(int parentIndex, int newChildIndex, int refChildIndex)
public void setAsLastChild(int parentIndex, int childIndex)
public int getParentNode(int nodeIndex)
public int getParentNode(int nodeIndex, boolean free)
free
- True to free parent node.public int getLastChild(int nodeIndex)
public int getLastChild(int nodeIndex, boolean free)
free
- True to free child index.public int getPrevSibling(int nodeIndex)
public int getPrevSibling(int nodeIndex, boolean free)
free
- True to free sibling index.public int getRealPrevSibling(int nodeIndex)
public int getRealPrevSibling(int nodeIndex, boolean free)
free
- True to free sibling index.public int lookupElementDefinition(String elementName)
public DeferredNode getNodeObject(int nodeIndex)
public String getNodeName(int nodeIndex)
public String getNodeName(int nodeIndex, boolean free)
free
- True to free the string index.public String getNodeValueString(int nodeIndex)
public String getNodeValueString(int nodeIndex, boolean free)
free
- True to free the string index.public String getNodeValue(int nodeIndex)
public Object getTypeInfo(int nodeIndex)
nodeIndex
- public String getNodeValue(int nodeIndex, boolean free)
free
- True to free the value index.public int getNodeExtra(int nodeIndex)
public int getNodeExtra(int nodeIndex, boolean free)
free
- True to free the value index.public short getNodeType(int nodeIndex)
public short getNodeType(int nodeIndex, boolean free)
free
- True to free type index.public String getAttribute(int elemIndex, String name)
public String getNodeURI(int nodeIndex)
public String getNodeURI(int nodeIndex, boolean free)
free
- True to free URI index.public void putIdentifier(String name, int elementNodeIndex)
public void print()
public int getNodeIndex()
getNodeIndex
in interface DeferredNode
protected void synchronizeData()
synchronizeData
in class NodeImpl
protected void synchronizeChildren()
synchronizeChildren
in class ParentNode
protected final void synchronizeChildren(AttrImpl a, int nodeIndex)
protected final void synchronizeChildren(ParentNode p, int nodeIndex)
protected void ensureCapacity(int chunk)
protected int createNode(short nodeType)
protected static int binarySearch(int[] values, int start, int end, int target)
values
- The array of values to search.start
- The starting offset of the search.end
- The ending offset of the search.target
- The target value.Copyright © 2012 JBoss by Red Hat. All Rights Reserved.