Top Fields Constructors Methods
org.jdom2.xpath.jaxen

pack-priv Class JDOMCoreNavigator

extends DefaultNavigator
Class Inheritance
Known Direct Subclasses
org.jdom2.xpath.jaxen.JDOMNavigator, org.jdom2.xpath.jaxen.JDOM2Navigator
Imports
java.io.IOException, java.util.Arrays, .IdentityHashMap, .Iterator, .List, org.jaxen.BaseXPath, .DefaultNavigator, .FunctionCallException, .JaxenConstants, .UnsupportedAxisException, .XPath, org.jaxen.saxpath.SAXPathException, org.jaxen.util.SingleObjectIterator, org.jdom2.Attribute, .Comment, .Content, .Document, .Element, .JDOMException, .Namespace, .Parent, .ProcessingInstruction, .Text, org.jdom2.input.SAXBuilder

Field Summary

Modifier and TypeField and Description
private transient IdentityHashMap<Element, NamespaceContainer[]>
private static final long
serialVersionUID

Standard JDOM2 Serialization.

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public final Iterator<?>
getAttributeAxisIterator(Object
the original context node
contextNode
)

Overrides org.jaxen.DefaultNavigator.getAttributeAxisIterator.

Implements org.jaxen.Navigator.getAttributeAxisIterator.

Retrieve an Iterator matching the attribute XPath axis.
public final String
getAttributeName(Object
the context attribute node
attribute
)

Implements org.jaxen.Navigator.getAttributeName.

Retrieve the local name of the given attribute node.
public final String
getAttributeNamespaceUri(Object
the context attribute node
attribute
)

Implements org.jaxen.Navigator.getAttributeNamespaceUri.

Retrieve the namespace URI of the given attribute node.
public final String
getAttributeQName(Object
the context attribute node
att
)

Implements org.jaxen.Navigator.getAttributeQName.

Retrieve the qualified name of the given attribute node.
public final String
getAttributeStringValue(Object
the attribute node
attribute
)

Implements org.jaxen.Navigator.getAttributeStringValue.

Retrieve the string-value of an attribute node.
public final Iterator<?>
getChildAxisIterator(Object
the node to start from
contextNode
)

Overrides org.jaxen.DefaultNavigator.getChildAxisIterator.

Implements org.jaxen.Navigator.getChildAxisIterator.

Throws UnsupportedAxisException.
public final String
getCommentStringValue(Object
the comment node
comment
)

Implements org.jaxen.Navigator.getCommentStringValue.

Retrieve the string-value of a comment node.
public final Object
getDocument(String
the URL of the document to load
url
)

Overrides org.jaxen.DefaultNavigator.getDocument.

Implements org.jaxen.Navigator.getDocument.

Default implementation that always returns null.
public final Object
getDocumentNode(Object
the node to start from
contextNode
)

Overrides org.jaxen.DefaultNavigator.getDocumentNode.

Implements org.jaxen.Navigator.getDocumentNode.

Returns null.
public final String
getElementName(Object
the context element node
element
)

Implements org.jaxen.Navigator.getElementName.

Retrieve the local name of the given element node.
public final String
getElementNamespaceUri(Object
the context element node
element
)

Implements org.jaxen.Navigator.getElementNamespaceUri.

Retrieve the namespace URI of the given element node.
public final String
getElementQName(Object
the context element node
element
)

Implements org.jaxen.Navigator.getElementQName.

Retrieve the qualified name of the given element node.
public final String
getElementStringValue(Object
the comment node.
element
)

Implements org.jaxen.Navigator.getElementStringValue.

Retrieve the string-value of an element node.
public final Iterator<?>
getNamespaceAxisIterator(final Object
the node to start from
contextNode
)

Overrides org.jaxen.DefaultNavigator.getNamespaceAxisIterator.

Implements org.jaxen.Navigator.getNamespaceAxisIterator.

Throws UnsupportedAxisException.
public final String
getNamespacePrefix(Object
the namespace node
namespace
)

Implements org.jaxen.Navigator.getNamespacePrefix.

Retrieve the namespace prefix of a namespace node.
public final String
getNamespaceStringValue(Object
the namespace node
namespace
)

Implements org.jaxen.Navigator.getNamespaceStringValue.

Retrieve the string-value of a namespace node.
public final Iterator<?>
getParentAxisIterator(Object
the node to start from
contextNode
)

Overrides org.jaxen.DefaultNavigator.getParentAxisIterator.

Implements org.jaxen.Navigator.getParentAxisIterator.

Throws UnsupportedAxisException.
public final Object
getParentNode(Object
the node whose parent to return
contextNode
)

Overrides org.jaxen.DefaultNavigator.getParentNode.

Implements org.jaxen.Navigator.getParentNode.

Default inefficient implementation.
public final String
public final String
public final String
getTextStringValue(Object
the text node
text
)

Implements org.jaxen.Navigator.getTextStringValue.

Retrieve the string-value of a text node.
public final boolean
isAttribute(Object
the object to test
isit
)

Implements org.jaxen.Navigator.isAttribute.

Returns whether the given object is an attribute node.
public final boolean
isComment(Object
the object to test
isit
)

Implements org.jaxen.Navigator.isComment.

Returns whether the given object is a comment node.
public final boolean
isDocument(Object
the object to test
isit
)

Implements org.jaxen.Navigator.isDocument.

Returns whether the given object is a document node.
public final boolean
isElement(Object
the object to test
isit
)

Implements org.jaxen.Navigator.isElement.

Returns whether the given object is an element node.
public final boolean
isNamespace(Object
the object to test
isit
)

Implements org.jaxen.Navigator.isNamespace.

Returns whether the given object is a namespace node.
public final boolean
isProcessingInstruction(Object
the object to test
isit
)

Implements org.jaxen.Navigator.isProcessingInstruction.

Returns whether the given object is a processing-instruction node.
public final boolean
isText(Object
the object to test
isit
)

Implements org.jaxen.Navigator.isText.

Returns whether the given object is a text node.
public final XPath
parseXPath(String
the XPath expression
path
)

Implements org.jaxen.Navigator.parseXPath.

Returns a parsed form of the given XPath string, which will be suitable for queries on documents that use the same navigator as this one.
private void
private final void
pack-priv void
private void
Inherited from org.jaxen.DefaultNavigator:
getAncestorAxisIteratorgetAncestorOrSelfAxisIteratorgetDescendantAxisIteratorgetDescendantOrSelfAxisIteratorgetElementByIdgetFollowingAxisIteratorgetFollowingSiblingAxisIteratorgetNodeTypegetPrecedingAxisIteratorgetPrecedingSiblingAxisIteratorgetSelfAxisIteratortranslateNamespacePrefixToUri

Field Detail

emtnsmapback to summary
private transient IdentityHashMap<Element, NamespaceContainer[]> emtnsmap
serialVersionUIDback to summary
private static final long serialVersionUID

Standard JDOM2 Serialization. Default mechanism.

Constructor Detail

JDOMCoreNavigatorback to summary
pack-priv JDOMCoreNavigator()

Method Detail

getAttributeAxisIteratorback to summary
public final Iterator<?> getAttributeAxisIterator(Object contextNode) throws UnsupportedAxisException

Overrides org.jaxen.DefaultNavigator.getAttributeAxisIterator.

Implements org.jaxen.Navigator.getAttributeAxisIterator.

Doc from org.jaxen.DefaultNavigator.getAttributeAxisIterator.

Retrieve an Iterator matching the attribute XPath axis.

Parameters
contextNode:Object

Doc from org.jaxen.Navigator.getAttributeAxisIterator.

the original context node

Returns:Iterator<?>

Doc from org.jaxen.Navigator.getAttributeAxisIterator.

an Iterator capable of traversing the axis, not null

Annotations
@Override
Exceptions
UnsupportedAxisException:

Doc from org.jaxen.Navigator.getAttributeAxisIterator.

if the semantics of the attribute axis are not supported by this object model

getAttributeNameback to summary
public final String getAttributeName(Object attribute)

Implements org.jaxen.Navigator.getAttributeName.

Doc from org.jaxen.Navigator.getAttributeName.

Retrieve the local name of the given attribute node.

Parameters
attribute:Object

the context attribute node

Returns:String

the local name of the attribute node

Annotations
@Override
getAttributeNamespaceUriback to summary
public final String getAttributeNamespaceUri(Object attribute)

Implements org.jaxen.Navigator.getAttributeNamespaceUri.

Doc from org.jaxen.Navigator.getAttributeNamespaceUri.

Retrieve the namespace URI of the given attribute node.

Parameters
attribute:Object

the context attribute node

Returns:String

the namespace URI of the attribute node

Annotations
@Override
getAttributeQNameback to summary
public final String getAttributeQName(Object att)

Implements org.jaxen.Navigator.getAttributeQName.

Doc from org.jaxen.Navigator.getAttributeQName.

Retrieve the qualified name of the given attribute node.

Parameters
att:Object

the context attribute node

Returns:String

the qualified name of the attribute node

Annotations
@Override
getAttributeStringValueback to summary
public final String getAttributeStringValue(Object attribute)

Implements org.jaxen.Navigator.getAttributeStringValue.

Doc from org.jaxen.Navigator.getAttributeStringValue.

Retrieve the string-value of an attribute node. This should be the XML 1.0 normalized attribute value. This may be the empty string but must not be null.

Parameters
attribute:Object

the attribute node

Returns:String

the string-value of the node

Annotations
@Override
getChildAxisIteratorback to summary
public final Iterator<?> getChildAxisIterator(Object contextNode) throws UnsupportedAxisException

Overrides org.jaxen.DefaultNavigator.getChildAxisIterator.

Implements org.jaxen.Navigator.getChildAxisIterator.

Doc from org.jaxen.DefaultNavigator.getChildAxisIterator.

Throws UnsupportedAxisException. Subclasses should override this method.

Parameters
contextNode:Object

the node to start from

Returns:Iterator<?>

never returns

Annotations
@Override
Exceptions
UnsupportedAxisException:
always
getCommentStringValueback to summary
public final String getCommentStringValue(Object comment)

Implements org.jaxen.Navigator.getCommentStringValue.

Doc from org.jaxen.Navigator.getCommentStringValue.

Retrieve the string-value of a comment node. This may be the empty string if the comment is empty, but must not be null.

Parameters
comment:Object

the comment node

Returns:String

the string-value of the node

Annotations
@Override
getDocumentback to summary
public final Object getDocument(String url) throws FunctionCallException

Overrides org.jaxen.DefaultNavigator.getDocument.

Implements org.jaxen.Navigator.getDocument.

Doc from org.jaxen.DefaultNavigator.getDocument.

Default implementation that always returns null. Override in subclass if the subclass can load documents.

Parameters
url:String

the URL of the document to load

Returns:Object

null

Annotations
@Override
Exceptions
FunctionCallException:
if an error occurs while loading the URL; e.g. an I/O error or the document is malformed
getDocumentNodeback to summary
public final Object getDocumentNode(Object contextNode)

Overrides org.jaxen.DefaultNavigator.getDocumentNode.

Implements org.jaxen.Navigator.getDocumentNode.

Doc from org.jaxen.DefaultNavigator.getDocumentNode.

Returns null.

Parameters
contextNode:Object

the node to start from

Returns:Object

null

Annotations
@Override
getElementNameback to summary
public final String getElementName(Object element)

Implements org.jaxen.Navigator.getElementName.

Doc from org.jaxen.Navigator.getElementName.

Retrieve the local name of the given element node.

Parameters
element:Object

the context element node

Returns:String

the local name of the element node

Annotations
@Override
getElementNamespaceUriback to summary
public final String getElementNamespaceUri(Object element)

Implements org.jaxen.Navigator.getElementNamespaceUri.

Doc from org.jaxen.Navigator.getElementNamespaceUri.

Retrieve the namespace URI of the given element node.

Parameters
element:Object

the context element node

Returns:String

the namespace URI of the element node

Annotations
@Override
getElementQNameback to summary
public final String getElementQName(Object element)

Implements org.jaxen.Navigator.getElementQName.

Doc from org.jaxen.Navigator.getElementQName.

Retrieve the qualified name of the given element node.

Parameters
element:Object

the context element node

Returns:String

the qualified name of the element node

Annotations
@Override
getElementStringValueback to summary
public final String getElementStringValue(Object element)

Implements org.jaxen.Navigator.getElementStringValue.

Doc from org.jaxen.Navigator.getElementStringValue.

Retrieve the string-value of an element node. This may be the empty string if the element is empty, but must not be null.

Parameters
element:Object

the comment node.

Returns:String

the string-value of the node.

Annotations
@Override
getNamespaceAxisIteratorback to summary
public final Iterator<?> getNamespaceAxisIterator(final Object contextNode) throws UnsupportedAxisException

Overrides org.jaxen.DefaultNavigator.getNamespaceAxisIterator.

Implements org.jaxen.Navigator.getNamespaceAxisIterator.

Doc from org.jaxen.DefaultNavigator.getNamespaceAxisIterator.

Throws UnsupportedAxisException. Subclasses that support the namespace axis must override this method.

Parameters
contextNode:Object

the node to start from

Returns:Iterator<?>

never returns

Annotations
@Override
Exceptions
UnsupportedAxisException:
always
getNamespacePrefixback to summary
public final String getNamespacePrefix(Object namespace)

Implements org.jaxen.Navigator.getNamespacePrefix.

Doc from org.jaxen.Navigator.getNamespacePrefix.

Retrieve the namespace prefix of a namespace node.

Parameters
namespace:Object

the namespace node

Returns:String

the prefix associated with the node

Annotations
@Override
getNamespaceStringValueback to summary
public final String getNamespaceStringValue(Object namespace)

Implements org.jaxen.Navigator.getNamespaceStringValue.

Doc from org.jaxen.Navigator.getNamespaceStringValue.

Retrieve the string-value of a namespace node. This is generally the namespace URI. This may be the empty string but must not be null.

Parameters
namespace:Object

the namespace node

Returns:String

the string-value of the node

Annotations
@Override
getParentAxisIteratorback to summary
public final Iterator<?> getParentAxisIterator(Object contextNode) throws UnsupportedAxisException

Overrides org.jaxen.DefaultNavigator.getParentAxisIterator.

Implements org.jaxen.Navigator.getParentAxisIterator.

Doc from org.jaxen.DefaultNavigator.getParentAxisIterator.

Throws UnsupportedAxisException. Subclasses should override this method.

Parameters
contextNode:Object

the node to start from

Returns:Iterator<?>

never returns

Annotations
@Override
Exceptions
UnsupportedAxisException:
always
getParentNodeback to summary
public final Object getParentNode(Object contextNode) throws UnsupportedAxisException

Overrides org.jaxen.DefaultNavigator.getParentNode.

Implements org.jaxen.Navigator.getParentNode.

Doc from org.jaxen.DefaultNavigator.getParentNode.

Default inefficient implementation. Subclasses should override this method.

Parameters
contextNode:Object

the node whose parent to return

Returns:Object

the parent node

Annotations
@Override
Exceptions
UnsupportedAxisException:
if the parent axis is not supported
getProcessingInstructionDataback to summary
public final String getProcessingInstructionData(Object pi)

Overrides org.jaxen.DefaultNavigator.getProcessingInstructionData.

Implements org.jaxen.Navigator.getProcessingInstructionData.

Doc from org.jaxen.DefaultNavigator.getProcessingInstructionData.

Returns null.

Parameters
pi:Object

the node to start from

Returns:String

null

Annotations
@Override
getProcessingInstructionTargetback to summary
public final String getProcessingInstructionTarget(Object pi)

Overrides org.jaxen.DefaultNavigator.getProcessingInstructionTarget.

Implements org.jaxen.Navigator.getProcessingInstructionTarget.

Doc from org.jaxen.DefaultNavigator.getProcessingInstructionTarget.

Returns null.

Parameters
pi:Object

the node to start from

Returns:String

null

Annotations
@Override
getTextStringValueback to summary
public final String getTextStringValue(Object text)

Implements org.jaxen.Navigator.getTextStringValue.

Doc from org.jaxen.Navigator.getTextStringValue.

Retrieve the string-value of a text node. This must not be null and should not be the empty string. The XPath data model does not allow empty text nodes.

Parameters
text:Object

the text node

Returns:String

the string-value of the node

Annotations
@Override
isAttributeback to summary
public final boolean isAttribute(Object isit)

Implements org.jaxen.Navigator.isAttribute.

Doc from org.jaxen.Navigator.isAttribute.

Returns whether the given object is an attribute node.

Parameters
isit:Object

the object to test

Returns:boolean

true if the object is an attribute node, else false

Annotations
@Override
isCommentback to summary
public final boolean isComment(Object isit)

Implements org.jaxen.Navigator.isComment.

Doc from org.jaxen.Navigator.isComment.

Returns whether the given object is a comment node.

Parameters
isit:Object

the object to test

Returns:boolean

true if the object is a comment node, else false

Annotations
@Override
isDocumentback to summary
public final boolean isDocument(Object isit)

Implements org.jaxen.Navigator.isDocument.

Doc from org.jaxen.Navigator.isDocument.

Returns whether the given object is a document node. A document node is the node that is selected by the XPath expression /.

Parameters
isit:Object

the object to test

Returns:boolean

true if the object is a document node, else false

Annotations
@Override
isElementback to summary
public final boolean isElement(Object isit)

Implements org.jaxen.Navigator.isElement.

Doc from org.jaxen.Navigator.isElement.

Returns whether the given object is an element node.

Parameters
isit:Object

the object to test

Returns:boolean

true if the object is an element node, else false

Annotations
@Override
isNamespaceback to summary
public final boolean isNamespace(Object isit)

Implements org.jaxen.Navigator.isNamespace.

Doc from org.jaxen.Navigator.isNamespace.

Returns whether the given object is a namespace node.

Parameters
isit:Object

the object to test

Returns:boolean

true if the object is a namespace node, else false

Annotations
@Override
isProcessingInstructionback to summary
public final boolean isProcessingInstruction(Object isit)

Implements org.jaxen.Navigator.isProcessingInstruction.

Doc from org.jaxen.Navigator.isProcessingInstruction.

Returns whether the given object is a processing-instruction node.

Parameters
isit:Object

the object to test

Returns:boolean

true if the object is a processing-instruction node, else false

Annotations
@Override
isTextback to summary
public final boolean isText(Object isit)

Implements org.jaxen.Navigator.isText.

Doc from org.jaxen.Navigator.isText.

Returns whether the given object is a text node.

Parameters
isit:Object

the object to test

Returns:boolean

true if the object is a text node, else false

Annotations
@Override
parseXPathback to summary
public final XPath parseXPath(String path) throws SAXPathException

Implements org.jaxen.Navigator.parseXPath.

Doc from org.jaxen.Navigator.parseXPath.

Returns a parsed form of the given XPath string, which will be suitable for queries on documents that use the same navigator as this one.

Parameters
path:String

the XPath expression

Returns:XPath

a new XPath expression object

Annotations
@Override
Exceptions
SAXPathException:
if the string is not a syntactically correct XPath expression
readObjectback to summary
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException
recurseElementTextback to summary
private final void recurseElementText(Element element, StringBuilder sb)
resetback to summary
pack-priv void reset()
writeObjectback to summary
private void writeObject(ObjectOutputStream out) throws IOException