|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sf.saxon.dom.NodeOverNodeInfo
This class implements the DOM Node interface as a wrapper around a Saxon NodeInfo object.
The class provides read-only access to the tree; methods that request updates all fail with an UnsupportedOperationException.
| Field Summary | |
protected NodeInfo |
node
|
| Fields inherited from interface org.w3c.dom.Node |
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE |
| Constructor Summary | |
NodeOverNodeInfo()
|
|
| Method Summary | |
org.w3c.dom.Node |
appendChild(org.w3c.dom.Node newChild)
Adds the node newChild to the end of the list of children
of this node. |
org.w3c.dom.Node |
cloneNode(boolean deep)
Returns a duplicate of this node, i.e., serves as a generic copy constructor for nodes. |
short |
compareDocumentPosition(org.w3c.dom.Node other)
Compare the position of the (other) node in document order with the reference node (this node). |
protected static void |
disallowUpdate()
Internal method used to indicate that update operations are not allowed |
org.w3c.dom.NamedNodeMap |
getAttributes()
Return a NamedNodeMap containing the attributes of this node (if
it is an Element) or null otherwise. |
java.lang.String |
getBaseURI()
Get the base URI for the node. |
org.w3c.dom.NodeList |
getChildNodes()
Return a NodeList that contains all children of this node. |
java.lang.Object |
getFeature(java.lang.String feature,
java.lang.String version)
Get a feature of this node. |
org.w3c.dom.Node |
getFirstChild()
Get first child |
org.w3c.dom.Node |
getLastChild()
Get last child |
java.lang.String |
getLocalName()
Get the local name of this node, following the DOM rules |
java.lang.String |
getNamespaceURI()
The namespace URI of this node, or null if it is
unspecified. |
org.w3c.dom.Node |
getNextSibling()
Get next sibling node |
java.lang.String |
getNodeName()
Get the name of this node, following the DOM rules |
short |
getNodeType()
Get the type of this node (node kind, in XPath terminology). |
java.lang.String |
getNodeValue()
Get the node value (as defined in the DOM). |
org.w3c.dom.Document |
getOwnerDocument()
Return the Document object associated with this node. |
org.w3c.dom.Node |
getParentNode()
Find the parent node of this node. |
java.lang.String |
getPrefix()
The namespace prefix of this node, or null if it is
unspecified. |
org.w3c.dom.Node |
getPreviousSibling()
Get the previous sibling of the node |
java.lang.String |
getTextContent()
Get the text content of a node. |
NodeInfo |
getUnderlyingNodeInfo()
Get the Saxon NodeInfo object representing this node |
java.lang.Object |
getUserData(java.lang.String key)
Get user data associated with this node. |
boolean |
hasAttributes()
Returns whether this node has any attributes. |
boolean |
hasChildNodes()
Determine whether the node has any children. |
org.w3c.dom.Node |
insertBefore(org.w3c.dom.Node newChild,
org.w3c.dom.Node refChild)
Insert the node newChild before the existing child node
refChild. |
boolean |
isDefaultNamespace(java.lang.String namespaceURI)
Test whether a particular namespace is the default namespace. |
boolean |
isEqualNode(org.w3c.dom.Node arg)
Compare whether two nodes have the same content. |
boolean |
isSameNode(org.w3c.dom.Node other)
Determine whether this is the same node as another node. |
boolean |
isSupported(java.lang.String feature,
java.lang.String version)
Tests whether the DOM implementation implements a specific feature and that feature is supported by this node. |
java.lang.String |
lookupNamespaceURI(java.lang.String prefix)
Find the URI corresponding to a given in-scope prefix |
java.lang.String |
lookupPrefix(java.lang.String namespaceURI)
Get the (first) prefix assigned to a specified namespace URI, or null if the namespace is not in scope. |
void |
normalize()
Puts all Text nodes in the full depth of the sub-tree
underneath this Node, including attribute nodes, into a
"normal" form where only structure (e.g., elements, comments,
processing instructions, CDATA sections, and entity references)
separates Text nodes, i.e., there are neither adjacent
Text nodes nor empty Text nodes. |
org.w3c.dom.Node |
removeChild(org.w3c.dom.Node oldChild)
Remove the child node indicated by oldChild from the
list of children, and returns it. |
org.w3c.dom.Node |
replaceChild(org.w3c.dom.Node newChild,
org.w3c.dom.Node oldChild)
Replace the child node oldChild with
newChild in the list of children, and returns the
oldChild node. |
void |
setNodeValue(java.lang.String nodeValue)
Set the node value. |
void |
setPrefix(java.lang.String prefix)
Set the namespace prefix of this node. |
void |
setTextContent(java.lang.String textContent)
Set the text content of a node. |
java.lang.Object |
setUserData(java.lang.String key,
java.lang.Object data,
org.w3c.dom.UserDataHandler handler)
Set user data. |
static NodeOverNodeInfo |
wrap(NodeInfo node)
Factory method to construct a DOM node that wraps an underlying Saxon NodeInfo |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected NodeInfo node
| Constructor Detail |
public NodeOverNodeInfo()
| Method Detail |
public NodeInfo getUnderlyingNodeInfo()
public static NodeOverNodeInfo wrap(NodeInfo node)
node - the Saxon NodeInfo object
public final boolean isSameNode(org.w3c.dom.Node other)
public java.lang.String getBaseURI()
public java.lang.String getNodeName()
getNodeName in interface org.w3c.dom.Nodepublic java.lang.String getLocalName()
getLocalName in interface org.w3c.dom.Nodepublic boolean hasChildNodes()
hasChildNodes in interface org.w3c.dom.Nodetrue if this node has any attributes,
false otherwise.public boolean hasAttributes()
hasAttributes in interface org.w3c.dom.Nodetrue if this node has any attributes,
false otherwise.public short getNodeType()
Type) are the same as those assigned in the DOM
getNodeType in interface org.w3c.dom.Nodepublic org.w3c.dom.Node getParentNode()
getParentNode in interface org.w3c.dom.Nodepublic org.w3c.dom.Node getPreviousSibling()
getPreviousSibling in interface org.w3c.dom.Nodepublic org.w3c.dom.Node getNextSibling()
getNextSibling in interface org.w3c.dom.Nodepublic org.w3c.dom.Node getFirstChild()
getFirstChild in interface org.w3c.dom.Nodepublic org.w3c.dom.Node getLastChild()
getLastChild in interface org.w3c.dom.Nodepublic java.lang.String getNodeValue()
getNodeValue in interface org.w3c.dom.Node
public void setNodeValue(java.lang.String nodeValue)
throws org.w3c.dom.DOMException
setNodeValue in interface org.w3c.dom.Nodeorg.w3c.dom.DOMExceptionpublic org.w3c.dom.NodeList getChildNodes()
NodeList that contains all children of this node. If
there are no children, this is a NodeList containing no
nodes.
getChildNodes in interface org.w3c.dom.Nodepublic org.w3c.dom.NamedNodeMap getAttributes()
NamedNodeMap containing the attributes of this node (if
it is an Element) or null otherwise. Note that this
implementation changed in Saxon 8.8 to treat namespace declarations as attributes.
getAttributes in interface org.w3c.dom.Nodepublic org.w3c.dom.Document getOwnerDocument()
Document object associated with this node.
getOwnerDocument in interface org.w3c.dom.Node
public org.w3c.dom.Node insertBefore(org.w3c.dom.Node newChild,
org.w3c.dom.Node refChild)
throws org.w3c.dom.DOMException
newChild before the existing child node
refChild. Always fails.
insertBefore in interface org.w3c.dom.NodenewChild - The node to insert.refChild - The reference node, i.e., the node before which the
new node must be inserted.
org.w3c.dom.DOMException - NO_MODIFICATION_ALLOWED_ERR: Always raised.
public org.w3c.dom.Node replaceChild(org.w3c.dom.Node newChild,
org.w3c.dom.Node oldChild)
throws org.w3c.dom.DOMException
oldChild with
newChild in the list of children, and returns the
oldChild node. Always fails.
replaceChild in interface org.w3c.dom.NodenewChild - The new node to put in the child list.oldChild - The node being replaced in the list.
org.w3c.dom.DOMException - NO_MODIFICATION_ALLOWED_ERR: Always raised.
public org.w3c.dom.Node removeChild(org.w3c.dom.Node oldChild)
throws org.w3c.dom.DOMException
oldChild from the
list of children, and returns it. Always fails.
removeChild in interface org.w3c.dom.NodeoldChild - The node being removed.
org.w3c.dom.DOMException - NO_MODIFICATION_ALLOWED_ERR: Always raised.
public org.w3c.dom.Node appendChild(org.w3c.dom.Node newChild)
throws org.w3c.dom.DOMException
newChild to the end of the list of children
of this node. Always fails.
appendChild in interface org.w3c.dom.NodenewChild - The node to add.
org.w3c.dom.DOMException - public org.w3c.dom.Node cloneNode(boolean deep)
cloneNode in interface org.w3c.dom.Nodedeep - If true , recursively clone the subtree under
the specified node; if false , clone only the node
itself (and its attributes, if it is an Element ).
public void normalize()
Text nodes in the full depth of the sub-tree
underneath this Node, including attribute nodes, into a
"normal" form where only structure (e.g., elements, comments,
processing instructions, CDATA sections, and entity references)
separates Text nodes, i.e., there are neither adjacent
Text nodes nor empty Text nodes.
normalize in interface org.w3c.dom.Node
public boolean isSupported(java.lang.String feature,
java.lang.String version)
isSupported in interface org.w3c.dom.Nodefeature - The name of the feature to test. This is the same name
which can be passed to the method hasFeature on
DOMImplementation .version - This is the version number of the feature to test. In
Level 2, version 1, this is the string "2.0". If the version is not
specified, supporting any version of the feature will cause the
method to return true .
true if the specified feature is supported
on this node, false otherwise.public java.lang.String getNamespaceURI()
null if it is
unspecified.
ELEMENT_NODE and
ATTRIBUTE_NODE and nodes created with a DOM Level 1
method, such as createElement from the
Document interface, this is always null .
Per the Namespaces in XML Specification an attribute does not
inherit its namespace from the element it is attached to. If an
attribute is not explicitly given a namespace, it simply has no
namespace.
getNamespaceURI in interface org.w3c.dom.Nodepublic java.lang.String getPrefix()
null if it is
unspecified.
ELEMENT_NODE and
ATTRIBUTE_NODE and nodes created with a DOM Level 1
method, such as createElement from the
Document interface, this is always null.
getPrefix in interface org.w3c.dom.Node
public void setPrefix(java.lang.String prefix)
throws org.w3c.dom.DOMException
setPrefix in interface org.w3c.dom.Nodeorg.w3c.dom.DOMException
public short compareDocumentPosition(org.w3c.dom.Node other)
throws org.w3c.dom.DOMException
other - the other node.
org.w3c.dom.DOMException
public java.lang.String getTextContent()
throws org.w3c.dom.DOMException
org.w3c.dom.DOMException
public void setTextContent(java.lang.String textContent)
throws org.w3c.dom.DOMException
textContent -
org.w3c.dom.DOMExceptionpublic java.lang.String lookupPrefix(java.lang.String namespaceURI)
namespaceURI - the namespace whose prefix is required
public boolean isDefaultNamespace(java.lang.String namespaceURI)
namespaceURI - the namespace to be tested
public java.lang.String lookupNamespaceURI(java.lang.String prefix)
prefix - The namespace prefix whose namespace URI is required.
public boolean isEqualNode(org.w3c.dom.Node arg)
arg - The node to be compared. This must wrap a Saxon NodeInfo.
public java.lang.Object getFeature(java.lang.String feature,
java.lang.String version)
feature - the required featureversion - the version of the required feature
public java.lang.Object setUserData(java.lang.String key,
java.lang.Object data,
org.w3c.dom.UserDataHandler handler)
key - data - handler -
public java.lang.Object getUserData(java.lang.String key)
key - identifies the user data required
protected static void disallowUpdate()
throws org.w3c.dom.DOMException
org.w3c.dom.DOMException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||