public abstract class NodeImpl extends Object implements 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 |
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) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
appendChild, getChildNodes, getNextSibling, getNodeName, getNodeType, insertBefore, lookupNamespaceURI, removeChild, replaceChild
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)
public boolean hasAttributes()
hasAttributes
in interface Node
public boolean hasChildNodes()
hasChildNodes
in interface Node
public String getLocalName()
getLocalName
in interface Node
public String getNamespaceURI()
getNamespaceURI
in interface Node
public String getNodeValue() throws DOMException
getNodeValue
in interface Node
DOMException
public void setNodeValue(String nodeValue) throws DOMException
setNodeValue
in interface Node
DOMException
public void setPrefix(String prefix) throws DOMException
setPrefix
in interface Node
DOMException
public NamedNodeMap getAttributes()
getAttributes
in interface Node
ElementImpl
public Node getFirstChild()
getFirstChild
in interface Node
ParentNode
public Node getLastChild()
getLastChild
in interface Node
ParentNode
public boolean isSupported(String feature, String version)
isSupported
in interface Node
public String getBaseURI()
getBaseURI
in interface Node
public short compareDocumentPosition(Node other) throws DOMException
compareDocumentPosition
in interface Node
DOMException
public String getTextContent() throws DOMException
getTextContent
in interface Node
DOMException
public void setTextContent(String textContent) throws DOMException
setTextContent
in interface Node
DOMException
public boolean isSameNode(Node node)
isSameNode
in interface Node
public String lookupPrefix(String namespaceURI)
lookupPrefix
in interface Node
public boolean isDefaultNamespace(String namespaceURI)
isDefaultNamespace
in interface Node
public boolean isEqualNode(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 Node
node
- The node to compare equality with.true
if the nodes are equal, false
otherwise.public Object getFeature(String feature, String version)
getFeature
in interface Node
public Object setUserData(String key, Object value, UserDataHandler userDataHandler)
setUserData
in interface Node
public Object getUserData(String key)
getUserData
in interface Node
public OMFactory getOMFactory()
OMFactory
that created this nodepublic Document getOwnerDocument()
getOwnerDocument
in interface Node
public final OMNode getNextOMSiblingIfAvailable()
public final OMNode getPreviousOMSibling()
public final Node getPreviousSibling()
getPreviousSibling
in interface Node
public final void setNextOMSibling(OMNode node)
public final void setPreviousOMSibling(OMNode node)
public final OMContainer getParent() throws OMException
OMException
public Node getParentNode()
getParentNode
in interface Node
public final void setParent(OMContainer element)
protected void setParent(ParentNode parent, boolean useDomSemantics)
public OMNode detach() throws OMException
OMException
public void insertSiblingAfter(OMNode sibling) throws OMException
OMException
public void insertSiblingBefore(OMNode sibling) throws OMException
OMException
public abstract OMXMLParserWrapper getBuilder()
public abstract void setComplete(boolean state)
public abstract boolean isComplete()
public void buildWithAttachments()
public void close(boolean build)
public void serialize(XMLStreamWriter xmlWriter) throws XMLStreamException
XMLStreamException
public void serializeAndConsume(XMLStreamWriter xmlWriter) throws XMLStreamException
XMLStreamException
public void serialize(XMLStreamWriter xmlWriter, boolean cache) throws XMLStreamException
XMLStreamException
public void serialize(OutputStream output) throws XMLStreamException
XMLStreamException
public void serialize(Writer writer) throws XMLStreamException
XMLStreamException
public void serializeAndConsume(OutputStream output) throws XMLStreamException
XMLStreamException
public void serializeAndConsume(Writer writer) throws XMLStreamException
XMLStreamException
public void serialize(OutputStream output, OMOutputFormat format) throws XMLStreamException
XMLStreamException
public void serialize(Writer writer2, OMOutputFormat format) throws XMLStreamException
XMLStreamException
public void serializeAndConsume(OutputStream output, OMOutputFormat format) throws XMLStreamException
XMLStreamException
public void serializeAndConsume(Writer writer2, OMOutputFormat format) throws XMLStreamException
XMLStreamException
public void internalSerialize(XMLStreamWriter writer) throws XMLStreamException
XMLStreamException
public void internalSerializeAndConsume(XMLStreamWriter writer) throws XMLStreamException
XMLStreamException
public abstract void internalSerialize(XMLStreamWriter writer, boolean cache) throws XMLStreamException
XMLStreamException
public final OMInformationItem clone(OMCloneOptions options)
Copyright © 2004–2019 The Apache Software Foundation. All rights reserved.