|
|||||||||
| Home >> All >> org >> apache >> xpath >> [ domapi overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
org.apache.xpath.domapi
Class XPathNamespaceImpl

java.lang.Objectorg.apache.xpath.domapi.XPathNamespaceImpl
- All Implemented Interfaces:
- org.w3c.dom.Node, org.w3c.dom.xpath.XPathNamespace
- public class XPathNamespaceImpl
- extends java.lang.Object
- implements org.w3c.dom.xpath.XPathNamespace
- extends java.lang.Object
The XPathNamespace interface is returned by
XPathResult interfaces to represent the XPath namespace node
type that DOM lacks. There is no public constructor for this node type.
Attempts to place it into a hierarchy or a NamedNodeMap result in a
DOMException with the code HIERARCHY_REQUEST_ERR
. This node is read only, so methods or setting of attributes that would
mutate the node result in a DOMException with the code
NO_MODIFICATION_ALLOWED_ERR.
The core specification describes attributes of the Node
interface that are different for different node node types but does not
describe XPATH_NAMESPACE_NODE, so here is a description of
those attributes for this node type. All attributes of Node
not described in this section have a null or
false value.
ownerDocument matches the ownerDocument of the
ownerElement even if the element is later adopted.
prefix is the prefix of the namespace represented by the
node.
nodeName is the same as prefix.
nodeType is equal to XPATH_NAMESPACE_NODE.
namespaceURI is the namespace URI of the namespace
represented by the node.
adoptNode, cloneNode, and
importNode fail on this node type by raising a
DOMException with the code NOT_SUPPORTED_ERR.In
future versions of the XPath specification, the definition of a namespace
node may be changed incomatibly, in which case incompatible changes to
field values may be required to implement versions beyond XPath 1.0.
See also the Document Object Model (DOM) Level 3 XPath Specification. This implementation wraps the DOM attribute node that contained the namespace declaration.
| Field Summary | |
(package private) org.w3c.dom.Node |
m_attributeNode
|
| Fields inherited from interface org.w3c.dom.xpath.XPathNamespace |
XPATH_NAMESPACE_NODE |
| Constructor Summary | |
XPathNamespaceImpl(org.w3c.dom.Node node)
Constructor for XPathNamespaceImpl. |
|
| Method Summary | |
org.w3c.dom.Node |
appendChild(org.w3c.dom.Node arg0)
Adds the node newChild to the end of the list of children
of this node. |
org.w3c.dom.Node |
cloneNode(boolean arg0)
Returns a duplicate of this node, i.e., serves as a generic copy constructor for nodes. |
org.w3c.dom.NamedNodeMap |
getAttributes()
A NamedNodeMap containing the attributes of this node (if
it is an Element) or null otherwise. |
org.w3c.dom.NodeList |
getChildNodes()
A NodeList that contains all children of this node. |
org.w3c.dom.Node |
getFirstChild()
The first child of this node. |
org.w3c.dom.Node |
getLastChild()
The last child of this node. |
java.lang.String |
getLocalName()
Returns the local part of the qualified name of this node. |
java.lang.String |
getNamespaceURI()
The namespace URI of this node, or null if it is
unspecified (see ). |
org.w3c.dom.Node |
getNextSibling()
The node immediately following this node. |
java.lang.String |
getNodeName()
The name of this node, depending on its type; see the table above. |
short |
getNodeType()
A code representing the type of the underlying object, as defined above. |
java.lang.String |
getNodeValue()
The value of this node, depending on its type; see the table above. |
org.w3c.dom.Document |
getOwnerDocument()
The Document object associated with this node. |
org.w3c.dom.Element |
getOwnerElement()
The Element on which the namespace was in scope when it
was requested. |
org.w3c.dom.Node |
getParentNode()
The parent of this node. |
java.lang.String |
getPrefix()
The namespace prefix of this node, or null if it is
unspecified. |
org.w3c.dom.Node |
getPreviousSibling()
The node immediately preceding this node. |
boolean |
hasAttributes()
Returns whether this node (if it is an element) has any attributes. |
boolean |
hasChildNodes()
Returns whether this node has any children. |
org.w3c.dom.Node |
insertBefore(org.w3c.dom.Node arg0,
org.w3c.dom.Node arg1)
Inserts the node newChild before the existing child node
refChild. |
boolean |
isSupported(java.lang.String arg0,
java.lang.String arg1)
Tests whether the DOM implementation implements a specific feature and that feature is supported by this node, as specified in . |
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 arg0)
Removes the child node indicated by oldChild from the list
of children, and returns it. |
org.w3c.dom.Node |
replaceChild(org.w3c.dom.Node arg0,
org.w3c.dom.Node arg1)
Replaces the child node oldChild with newChild
in the list of children, and returns the oldChild node. |
void |
setNodeValue(java.lang.String arg0)
The value of this node, depending on its type; see the table above. |
void |
setPrefix(java.lang.String arg0)
The namespace prefix of this node, or null if it is
unspecified. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.w3c.dom.Node |
compareDocumentPosition, getBaseURI, getFeature, getTextContent, getUserData, isDefaultNamespace, isEqualNode, isSameNode, lookupNamespaceURI, lookupPrefix, setTextContent, setUserData |
| Field Detail |
m_attributeNode
org.w3c.dom.Node m_attributeNode
| Constructor Detail |
XPathNamespaceImpl
public XPathNamespaceImpl(org.w3c.dom.Node node)
- Constructor for XPathNamespaceImpl.
| Method Detail |
getOwnerElement
public org.w3c.dom.Element getOwnerElement()
- Description copied from interface:
org.w3c.dom.xpath.XPathNamespace - The
Elementon which the namespace was in scope when it was requested. This does not change on a returned namespace node even if the document changes such that the namespace goes out of scope on that element and this node is no longer found there by XPath.- Specified by:
getOwnerElementin interfaceorg.w3c.dom.xpath.XPathNamespace
getNodeName
public java.lang.String getNodeName()
- Description copied from interface:
org.w3c.dom.Node - The name of this node, depending on its type; see the table above.
- Specified by:
getNodeNamein interfaceorg.w3c.dom.Node
getNodeValue
public java.lang.String getNodeValue() throws org.w3c.dom.DOMException
- Description copied from interface:
org.w3c.dom.Node - The value of this node, depending on its type; see the table above.
When it is defined to be
null, setting it has no effect, including if the node is read-only.- Specified by:
getNodeValuein interfaceorg.w3c.dom.Node
setNodeValue
public void setNodeValue(java.lang.String arg0) throws org.w3c.dom.DOMException
- Description copied from interface:
org.w3c.dom.Node - The value of this node, depending on its type; see the table above.
When it is defined to be
null, setting it has no effect, including if the node is read-only.- Specified by:
setNodeValuein interfaceorg.w3c.dom.Node
getNodeType
public short getNodeType()
- Description copied from interface:
org.w3c.dom.Node - A code representing the type of the underlying object, as defined above.
- Specified by:
getNodeTypein interfaceorg.w3c.dom.Node
getParentNode
public org.w3c.dom.Node getParentNode()
- Description copied from interface:
org.w3c.dom.Node - The parent of this node. All nodes, except
Attr,Document,DocumentFragment,Entity, andNotationmay have a parent. However, if a node has just been created and not yet added to the tree, or if it has been removed from the tree, this isnull.- Specified by:
getParentNodein interfaceorg.w3c.dom.Node
getChildNodes
public org.w3c.dom.NodeList getChildNodes()
- Description copied from interface:
org.w3c.dom.Node - A
NodeListthat contains all children of this node. If there are no children, this is aNodeListcontaining no nodes.- Specified by:
getChildNodesin interfaceorg.w3c.dom.Node
getFirstChild
public org.w3c.dom.Node getFirstChild()
- Description copied from interface:
org.w3c.dom.Node - The first child of this node. If there is no such node, this returns
null.- Specified by:
getFirstChildin interfaceorg.w3c.dom.Node
getLastChild
public org.w3c.dom.Node getLastChild()
- Description copied from interface:
org.w3c.dom.Node - The last child of this node. If there is no such node, this returns
null.- Specified by:
getLastChildin interfaceorg.w3c.dom.Node
getPreviousSibling
public org.w3c.dom.Node getPreviousSibling()
- Description copied from interface:
org.w3c.dom.Node - The node immediately preceding this node. If there is no such node,
this returns
null.- Specified by:
getPreviousSiblingin interfaceorg.w3c.dom.Node
getNextSibling
public org.w3c.dom.Node getNextSibling()
- Description copied from interface:
org.w3c.dom.Node - The node immediately following this node. If there is no such node,
this returns
null.- Specified by:
getNextSiblingin interfaceorg.w3c.dom.Node
getAttributes
public org.w3c.dom.NamedNodeMap getAttributes()
- Description copied from interface:
org.w3c.dom.Node - A
NamedNodeMapcontaining the attributes of this node (if it is anElement) ornullotherwise.- Specified by:
getAttributesin interfaceorg.w3c.dom.Node
getOwnerDocument
public org.w3c.dom.Document getOwnerDocument()
- Description copied from interface:
org.w3c.dom.Node - The
Documentobject associated with this node. This is also theDocumentobject used to create new nodes. When this node is aDocumentor aDocumentTypewhich is not used with anyDocumentyet, this isnull.- Specified by:
getOwnerDocumentin interfaceorg.w3c.dom.Node
insertBefore
public org.w3c.dom.Node insertBefore(org.w3c.dom.Node arg0, org.w3c.dom.Node arg1) throws org.w3c.dom.DOMException
- Description copied from interface:
org.w3c.dom.Node - Inserts the node
newChildbefore the existing child noderefChild. IfrefChildisnull, insertnewChildat the end of the list of children.
IfnewChildis aDocumentFragmentobject, all of its children are inserted, in the same order, beforerefChild. If thenewChildis already in the tree, it is first removed.Note: Inserting a node before itself is implementation dependent.
- Specified by:
insertBeforein interfaceorg.w3c.dom.Node
replaceChild
public org.w3c.dom.Node replaceChild(org.w3c.dom.Node arg0, org.w3c.dom.Node arg1) throws org.w3c.dom.DOMException
- Description copied from interface:
org.w3c.dom.Node - Replaces the child node
oldChildwithnewChildin the list of children, and returns theoldChildnode.
IfnewChildis aDocumentFragmentobject,oldChildis replaced by all of theDocumentFragmentchildren, which are inserted in the same order. If thenewChildis already in the tree, it is first removed.Note: Replacing a node with itself is implementation dependent.
- Specified by:
replaceChildin interfaceorg.w3c.dom.Node
removeChild
public org.w3c.dom.Node removeChild(org.w3c.dom.Node arg0) throws org.w3c.dom.DOMException
- Description copied from interface:
org.w3c.dom.Node - Removes the child node indicated by
oldChildfrom the list of children, and returns it.- Specified by:
removeChildin interfaceorg.w3c.dom.Node
appendChild
public org.w3c.dom.Node appendChild(org.w3c.dom.Node arg0) throws org.w3c.dom.DOMException
- Description copied from interface:
org.w3c.dom.Node - Adds the node
newChildto the end of the list of children of this node. If thenewChildis already in the tree, it is first removed.- Specified by:
appendChildin interfaceorg.w3c.dom.Node
hasChildNodes
public boolean hasChildNodes()
- Description copied from interface:
org.w3c.dom.Node - Returns whether this node has any children.
- Specified by:
hasChildNodesin interfaceorg.w3c.dom.Node
cloneNode
public org.w3c.dom.Node cloneNode(boolean arg0)
- Description copied from interface:
org.w3c.dom.Node - Returns a duplicate of this node, i.e., serves as a generic copy
constructor for nodes. The duplicate node has no parent (
parentNodeisnull) and no user data. User data associated to the imported node is not carried over. However, if anyUserDataHandlershas been specified along with the associated data these handlers will be called with the appropriate parameters before this method returns.
Cloning anElementcopies all attributes and their values, including those generated by the XML processor to represent defaulted attributes, but this method does not copy any children it contains unless it is a deep clone. This includes text contained in an theElementsince the text is contained in a childTextnode. Cloning anAttrdirectly, as opposed to be cloned as part of anElementcloning operation, returns a specified attribute (specifiedistrue). Cloning anAttralways clones its children, since they represent its value, no matter whether this is a deep clone or not. Cloning anEntityReferenceautomatically constructs its subtree if a correspondingEntityis available, no matter whether this is a deep clone or not. Cloning any other type of node simply returns a copy of this node.
Note that cloning an immutable subtree results in a mutable copy, but the children of anEntityReferenceclone are readonly . In addition, clones of unspecifiedAttrnodes are specified. And, cloningDocument,DocumentType,Entity, andNotationnodes is implementation dependent.- Specified by:
cloneNodein interfaceorg.w3c.dom.Node
normalize
public void normalize()
- Description copied from interface:
org.w3c.dom.Node - Puts all
Textnodes in the full depth of the sub-tree underneath thisNode, including attribute nodes, into a "normal" form where only structure (e.g., elements, comments, processing instructions, CDATA sections, and entity references) separatesTextnodes, i.e., there are neither adjacentTextnodes nor emptyTextnodes. This can be used to ensure that the DOM view of a document is the same as if it were saved and re-loaded, and is useful when operations (such as XPointer [XPointer] lookups) that depend on a particular document tree structure are to be used. If the parameter "normalize-characters" of theDOMConfigurationobject attached to theNode.ownerDocumentistrue, this method will also fully normalize the characters of theTextnodes.Note: In cases where the document contains
CDATASections, the normalize operation alone may not be sufficient, since XPointers do not differentiate betweenTextnodes andCDATASectionnodes.- Specified by:
normalizein interfaceorg.w3c.dom.Node
isSupported
public boolean isSupported(java.lang.String arg0, java.lang.String arg1)
- Description copied from interface:
org.w3c.dom.Node - Tests whether the DOM implementation implements a specific feature and
that feature is supported by this node, as specified in .
- Specified by:
isSupportedin interfaceorg.w3c.dom.Node
getNamespaceURI
public java.lang.String getNamespaceURI()
- Description copied from interface:
org.w3c.dom.Node - The namespace URI of this node, or
nullif it is unspecified (see ).
This is not a computed value that is the result of a namespace lookup based on an examination of the namespace declarations in scope. It is merely the namespace URI given at creation time.
For nodes of any type other thanELEMENT_NODEandATTRIBUTE_NODEand nodes created with a DOM Level 1 method, such asDocument.createElement(), this is alwaysnull.Note: Per the Namespaces in XML Specification [XML Namespaces] 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.
- Specified by:
getNamespaceURIin interfaceorg.w3c.dom.Node
getPrefix
public java.lang.String getPrefix()
- Description copied from interface:
org.w3c.dom.Node - The namespace prefix of this node, or
nullif it is unspecified. When it is defined to benull, setting it has no effect, including if the node is read-only.
Note that setting this attribute, when permitted, changes thenodeNameattribute, which holds the qualified name, as well as thetagNameandnameattributes of theElementandAttrinterfaces, when applicable.
Setting the prefix tonullmakes it unspecified, setting it to an empty string is implementation dependent.
Note also that changing the prefix of an attribute that is known to have a default value, does not make a new attribute with the default value and the original prefix appear, since thenamespaceURIandlocalNamedo not change.
For nodes of any type other thanELEMENT_NODEandATTRIBUTE_NODEand nodes created with a DOM Level 1 method, such ascreateElementfrom theDocumentinterface, this is alwaysnull.- Specified by:
getPrefixin interfaceorg.w3c.dom.Node
setPrefix
public void setPrefix(java.lang.String arg0) throws org.w3c.dom.DOMException
- Description copied from interface:
org.w3c.dom.Node - The namespace prefix of this node, or
nullif it is unspecified. When it is defined to benull, setting it has no effect, including if the node is read-only.
Note that setting this attribute, when permitted, changes thenodeNameattribute, which holds the qualified name, as well as thetagNameandnameattributes of theElementandAttrinterfaces, when applicable.
Setting the prefix tonullmakes it unspecified, setting it to an empty string is implementation dependent.
Note also that changing the prefix of an attribute that is known to have a default value, does not make a new attribute with the default value and the original prefix appear, since thenamespaceURIandlocalNamedo not change.
For nodes of any type other thanELEMENT_NODEandATTRIBUTE_NODEand nodes created with a DOM Level 1 method, such ascreateElementfrom theDocumentinterface, this is alwaysnull.- Specified by:
setPrefixin interfaceorg.w3c.dom.Node
getLocalName
public java.lang.String getLocalName()
- Description copied from interface:
org.w3c.dom.Node - Returns the local part of the qualified name of this node.
For nodes of any type other thanELEMENT_NODEandATTRIBUTE_NODEand nodes created with a DOM Level 1 method, such asDocument.createElement(), this is alwaysnull.- Specified by:
getLocalNamein interfaceorg.w3c.dom.Node
hasAttributes
public boolean hasAttributes()
- Description copied from interface:
org.w3c.dom.Node - Returns whether this node (if it is an element) has any attributes.
- Specified by:
hasAttributesin interfaceorg.w3c.dom.Node
|
|||||||||
| Home >> All >> org >> apache >> xpath >> [ domapi overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC
org.apache.xpath.domapi.XPathNamespaceImpl