public abstract class NodeImpl
extends java.lang.Object
implements org.w3c.dom.Node
| Modifier and Type | Field and Description |
|---|---|
protected OMFactory |
factory
Factory that created this node
|
protected static short |
FIRSTCHILD |
protected short |
flags |
protected static short |
HAS_PARENT
Used by
ChildNode to determine the meaning of the ownerNode attribute. |
protected static short |
SPECIFIED |
private java.util.Hashtable |
userData
Holds the user data objects
|
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| Modifier | Constructor and Description |
|---|---|
protected |
NodeImpl(OMFactory factory) |
| Modifier and Type | Method and Description |
|---|---|
(package private) abstract void |
build() |
void |
buildWithAttachments()
Parses this node and builds the object structure in memory.
|
private boolean |
checkNamedNodeMapEquality(org.w3c.dom.Node node) |
(package private) void |
checkSameOwnerDocument(org.w3c.dom.Node otherNode) |
private boolean |
checkStringAttributeEquality(org.w3c.dom.Node node) |
OMInformationItem |
clone(OMCloneOptions options) |
(package private) abstract NodeImpl |
clone(OMCloneOptions options,
ParentNode targetParent,
boolean deep,
boolean namespaceRepairing) |
org.w3c.dom.Node |
cloneNode(boolean deep) |
void |
close(boolean build) |
short |
compareDocumentPosition(org.w3c.dom.Node other) |
OMNode |
detach() |
(package private) OMNode |
detach(boolean useDomSemantics) |
org.w3c.dom.NamedNodeMap |
getAttributes()
Returns the collection of attributes associated with this node, or null if none.
|
java.lang.String |
getBaseURI() |
abstract OMXMLParserWrapper |
getBuilder() |
java.lang.Object |
getFeature(java.lang.String feature,
java.lang.String version) |
org.w3c.dom.Node |
getFirstChild()
Gets the first child of this Node, or null if none.
|
org.w3c.dom.Node |
getLastChild()
Gets the last child of this Node, or null if none.
|
java.lang.String |
getLocalName() |
java.lang.String |
getNamespaceURI() |
OMNode |
getNextOMSiblingIfAvailable() |
java.lang.String |
getNodeValue() |
OMFactory |
getOMFactory()
Returns the
OMFactory that created this node |
org.w3c.dom.Document |
getOwnerDocument() |
OMContainer |
getParent() |
org.w3c.dom.Node |
getParentNode() |
java.lang.String |
getPrefix() |
OMNode |
getPreviousOMSibling() |
org.w3c.dom.Node |
getPreviousSibling() |
java.lang.String |
getTextContent() |
(package private) void |
getTextContent(java.lang.StringBuffer buf) |
java.lang.Object |
getUserData(java.lang.String key) |
boolean |
hasAttributes() |
boolean |
hasChildNodes() |
(package private) boolean |
hasParent() |
(package private) void |
hasParent(boolean value) |
void |
insertSiblingAfter(OMNode sibling)
Inserts the given sibling next to this item.
|
void |
insertSiblingBefore(OMNode sibling)
Inserts the given sibling before this item.
|
(package private) abstract NodeImpl |
internalGetNextSibling() |
(package private) abstract ParentNode |
internalGetOwnerNode()
Get the parent or the owner document of the node.
|
(package private) abstract NodeImpl |
internalGetPreviousSibling() |
void |
internalSerialize(javax.xml.stream.XMLStreamWriter writer) |
abstract void |
internalSerialize(javax.xml.stream.XMLStreamWriter writer,
boolean cache) |
void |
internalSerializeAndConsume(javax.xml.stream.XMLStreamWriter writer) |
(package private) abstract void |
internalSetNextSibling(NodeImpl nextSibling) |
(package private) abstract void |
internalSetOwnerNode(ParentNode ownerNode) |
(package private) abstract void |
internalSetPreviousSibling(NodeImpl previousSibling) |
abstract boolean |
isComplete() |
boolean |
isDefaultNamespace(java.lang.String namespaceURI) |
boolean |
isEqualNode(org.w3c.dom.Node node)
Tests whether two nodes are equal.
|
(package private) boolean |
isFirstChild() |
(package private) void |
isFirstChild(boolean value) |
boolean |
isSameNode(org.w3c.dom.Node node) |
(package private) boolean |
isSpecified() |
(package private) void |
isSpecified(boolean value) |
boolean |
isSupported(java.lang.String feature,
java.lang.String version) |
java.lang.String |
lookupPrefix(java.lang.String namespaceURI) |
void |
normalize() |
(package private) void |
normalize(DOMConfigurationImpl config) |
(package private) DocumentImpl |
ownerDocument()
Get the owner document of this node.
|
(package private) ParentNode |
parentNode() |
void |
serialize(java.io.OutputStream output) |
void |
serialize(java.io.OutputStream output,
OMOutputFormat format) |
void |
serialize(java.io.Writer writer) |
void |
serialize(java.io.Writer writer2,
OMOutputFormat format) |
void |
serialize(javax.xml.stream.XMLStreamWriter xmlWriter) |
void |
serialize(javax.xml.stream.XMLStreamWriter xmlWriter,
boolean cache) |
void |
serializeAndConsume(java.io.OutputStream output) |
void |
serializeAndConsume(java.io.OutputStream output,
OMOutputFormat format) |
void |
serializeAndConsume(java.io.Writer writer) |
void |
serializeAndConsume(java.io.Writer writer2,
OMOutputFormat format) |
void |
serializeAndConsume(javax.xml.stream.XMLStreamWriter xmlWriter) |
abstract void |
setComplete(boolean state) |
void |
setNextOMSibling(OMNode node) |
void |
setNodeValue(java.lang.String nodeValue) |
(package private) void |
setOwnerDocument(DocumentImpl document)
Sets the owner document.
|
void |
setParent(OMContainer element) |
protected void |
setParent(ParentNode parent,
boolean useDomSemantics) |
void |
setPrefix(java.lang.String prefix) |
void |
setPreviousOMSibling(OMNode node) |
void |
setTextContent(java.lang.String textContent) |
java.lang.Object |
setUserData(java.lang.String key,
java.lang.Object value,
org.w3c.dom.UserDataHandler userDataHandler) |
private java.util.Hashtable userData
protected OMFactory factory
protected short flags
protected static final short HAS_PARENT
ChildNode to determine the meaning of the ownerNode attribute.
If the flag is set, then the attribute contains the reference to the parent node. If the flag
is not set, then the node has no parent and the attribute stores a reference to the owner
document (which may be null if the owner document has not been created yet).protected static final short FIRSTCHILD
protected static final short SPECIFIED
protected NodeImpl(OMFactory factory)
void normalize(DOMConfigurationImpl config)
public void normalize()
normalize in interface org.w3c.dom.Nodepublic boolean hasAttributes()
hasAttributes in interface org.w3c.dom.Nodepublic boolean hasChildNodes()
hasChildNodes in interface org.w3c.dom.Nodepublic java.lang.String getLocalName()
getLocalName in interface org.w3c.dom.Nodepublic java.lang.String getNamespaceURI()
getNamespaceURI in interface org.w3c.dom.Nodepublic java.lang.String getNodeValue()
throws org.w3c.dom.DOMException
getNodeValue in interface org.w3c.dom.Nodeorg.w3c.dom.DOMExceptionpublic java.lang.String getPrefix()
getPrefix in interface org.w3c.dom.Nodepublic void setNodeValue(java.lang.String nodeValue)
throws org.w3c.dom.DOMException
setNodeValue in interface org.w3c.dom.Nodeorg.w3c.dom.DOMExceptionpublic void setPrefix(java.lang.String prefix)
throws org.w3c.dom.DOMException
setPrefix in interface org.w3c.dom.Nodeorg.w3c.dom.DOMExceptionpublic org.w3c.dom.NamedNodeMap getAttributes()
getAttributes in interface org.w3c.dom.NodeElementImplpublic org.w3c.dom.Node getFirstChild()
getFirstChild in interface org.w3c.dom.NodeParentNodepublic org.w3c.dom.Node getLastChild()
getLastChild in interface org.w3c.dom.NodeParentNodepublic final org.w3c.dom.Node cloneNode(boolean deep)
cloneNode in interface org.w3c.dom.Nodepublic boolean isSupported(java.lang.String feature,
java.lang.String version)
isSupported in interface org.w3c.dom.Nodefinal boolean hasParent()
final void hasParent(boolean value)
final boolean isFirstChild()
final void isFirstChild(boolean value)
final boolean isSpecified()
final void isSpecified(boolean value)
public java.lang.String getBaseURI()
getBaseURI in interface org.w3c.dom.Nodepublic short compareDocumentPosition(org.w3c.dom.Node other)
throws org.w3c.dom.DOMException
compareDocumentPosition in interface org.w3c.dom.Nodeorg.w3c.dom.DOMExceptionpublic java.lang.String getTextContent()
throws org.w3c.dom.DOMException
getTextContent in interface org.w3c.dom.Nodeorg.w3c.dom.DOMExceptionvoid getTextContent(java.lang.StringBuffer buf)
throws org.w3c.dom.DOMException
org.w3c.dom.DOMExceptionpublic void setTextContent(java.lang.String textContent)
throws org.w3c.dom.DOMException
setTextContent in interface org.w3c.dom.Nodeorg.w3c.dom.DOMExceptionpublic boolean isSameNode(org.w3c.dom.Node node)
isSameNode in interface org.w3c.dom.Nodepublic java.lang.String lookupPrefix(java.lang.String namespaceURI)
lookupPrefix in interface org.w3c.dom.Nodepublic boolean isDefaultNamespace(java.lang.String namespaceURI)
isDefaultNamespace in interface org.w3c.dom.Nodepublic boolean isEqualNode(org.w3c.dom.Node node)
Node.isSameNode(). All nodes that are the same will also be equal, though the
reverse may not be true. nodeName, localName,
namespaceURI, prefix, nodeValue . This is: they are
both null, or they have the same length and are character for character
identical. attributes NamedNodeMaps are equal. This
is: they are both null, or they have the same length and for each node that
exists in one map there is a node that exists in the other map and is equal, although not
necessarily at the same index. childNodes NodeLists
are equal. This is: they are both null, or they have the same length and contain
equal nodes at the same index. Note that normalization can affect equality; to avoid this,
nodes should be normalized before being compared. DocumentType nodes to be equal, the following conditions must also be satisfied:
publicId,
systemId, internalSubset. entities
NamedNodeMaps are equal. notations
NamedNodeMaps are equal. ownerDocument, baseURI, and
parentNode attributes, the specified attribute for
Attr nodes, the schemaTypeInfo attribute for Attr and
Element nodes, the Text.isElementContentWhitespace attribute for
Text nodes, as well as any user data or event listeners registered on the nodes.
Note: As a general rule, anything not mentioned in the description above is not significant in consideration of equality checking. Note that future versions of this specification may take into account more attributes and implementations conform to this specification are expected to be updated accordingly.
isEqualNode in interface org.w3c.dom.Nodenode - The node to compare equality with.true if the nodes are equal, false otherwise.private boolean checkStringAttributeEquality(org.w3c.dom.Node node)
private boolean checkNamedNodeMapEquality(org.w3c.dom.Node node)
public java.lang.Object getFeature(java.lang.String feature,
java.lang.String version)
getFeature in interface org.w3c.dom.Nodepublic java.lang.Object setUserData(java.lang.String key,
java.lang.Object value,
org.w3c.dom.UserDataHandler userDataHandler)
setUserData in interface org.w3c.dom.Nodepublic java.lang.Object getUserData(java.lang.String key)
getUserData in interface org.w3c.dom.Nodepublic OMFactory getOMFactory()
OMFactory that created this nodeabstract ParentNode internalGetOwnerNode()
HAS_PARENT flag.abstract void internalSetOwnerNode(ParentNode ownerNode)
abstract NodeImpl internalGetPreviousSibling()
abstract NodeImpl internalGetNextSibling()
abstract void internalSetPreviousSibling(NodeImpl previousSibling)
abstract void internalSetNextSibling(NodeImpl nextSibling)
final DocumentImpl ownerDocument()
Node.getOwnerDocument(), this
method returns a non null value when invoked on a Document instance.void checkSameOwnerDocument(org.w3c.dom.Node otherNode)
void setOwnerDocument(DocumentImpl document)
document - public org.w3c.dom.Document getOwnerDocument()
getOwnerDocument in interface org.w3c.dom.NodeParentNode parentNode()
public final OMNode getNextOMSiblingIfAvailable()
public final OMNode getPreviousOMSibling()
public final org.w3c.dom.Node getPreviousSibling()
getPreviousSibling in interface org.w3c.dom.Nodepublic final void setNextOMSibling(OMNode node)
public final void setPreviousOMSibling(OMNode node)
public final OMContainer getParent() throws OMException
OMExceptionpublic org.w3c.dom.Node getParentNode()
getParentNode in interface org.w3c.dom.Nodepublic final void setParent(OMContainer element)
protected void setParent(ParentNode parent, boolean useDomSemantics)
public OMNode detach() throws OMException
OMExceptionOMNode detach(boolean useDomSemantics)
public void insertSiblingAfter(OMNode sibling) throws OMException
OMExceptionpublic void insertSiblingBefore(OMNode sibling) throws OMException
OMExceptionpublic abstract OMXMLParserWrapper getBuilder()
public abstract void setComplete(boolean state)
public abstract boolean isComplete()
abstract void build()
public void buildWithAttachments()
public void close(boolean build)
public void serialize(javax.xml.stream.XMLStreamWriter xmlWriter)
throws javax.xml.stream.XMLStreamException
javax.xml.stream.XMLStreamExceptionpublic void serializeAndConsume(javax.xml.stream.XMLStreamWriter xmlWriter)
throws javax.xml.stream.XMLStreamException
javax.xml.stream.XMLStreamExceptionpublic void serialize(javax.xml.stream.XMLStreamWriter xmlWriter,
boolean cache)
throws javax.xml.stream.XMLStreamException
javax.xml.stream.XMLStreamExceptionpublic void serialize(java.io.OutputStream output)
throws javax.xml.stream.XMLStreamException
javax.xml.stream.XMLStreamExceptionpublic void serialize(java.io.Writer writer)
throws javax.xml.stream.XMLStreamException
javax.xml.stream.XMLStreamExceptionpublic void serializeAndConsume(java.io.OutputStream output)
throws javax.xml.stream.XMLStreamException
javax.xml.stream.XMLStreamExceptionpublic void serializeAndConsume(java.io.Writer writer)
throws javax.xml.stream.XMLStreamException
javax.xml.stream.XMLStreamExceptionpublic void serialize(java.io.OutputStream output,
OMOutputFormat format)
throws javax.xml.stream.XMLStreamException
javax.xml.stream.XMLStreamExceptionpublic void serialize(java.io.Writer writer2,
OMOutputFormat format)
throws javax.xml.stream.XMLStreamException
javax.xml.stream.XMLStreamExceptionpublic void serializeAndConsume(java.io.OutputStream output,
OMOutputFormat format)
throws javax.xml.stream.XMLStreamException
javax.xml.stream.XMLStreamExceptionpublic void serializeAndConsume(java.io.Writer writer2,
OMOutputFormat format)
throws javax.xml.stream.XMLStreamException
javax.xml.stream.XMLStreamExceptionpublic void internalSerialize(javax.xml.stream.XMLStreamWriter writer)
throws javax.xml.stream.XMLStreamException
javax.xml.stream.XMLStreamExceptionpublic void internalSerializeAndConsume(javax.xml.stream.XMLStreamWriter writer)
throws javax.xml.stream.XMLStreamException
javax.xml.stream.XMLStreamExceptionpublic abstract void internalSerialize(javax.xml.stream.XMLStreamWriter writer,
boolean cache)
throws javax.xml.stream.XMLStreamException
javax.xml.stream.XMLStreamExceptionpublic final OMInformationItem clone(OMCloneOptions options)
abstract NodeImpl clone(OMCloneOptions options, ParentNode targetParent, boolean deep, boolean namespaceRepairing)