Top Description Fields Constructors Methods
org.eclipse.persistence.internal.jpa.deployment.xml.parser

public Class XPathEngine

extends Object
Class Inheritance
Imports
org.eclipse.persistence.platform.xml.XMLPlatformException, org.w3c.dom.Element, .Node, .NodeList, .Text

INTERNAL Utility class for finding XML nodes using XPath expressions.

Field Summary

Modifier and TypeField and Description
private static final String
private static final String
private static XPathEngine
private static final String
private static final String
private static final String

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static XPathEngine
getInstance()

Return the XPathEngine singleton.

private NodeList
getNodes(Node contextNode, String xPathFragment)

private Node
getSingleNode(Node contextNode, String xPathFragment)

private boolean
sameName(Node node, String name)

private boolean
sameNamespaceURI(Node node, String namespaceURI)

private NodeList
selectAttributeNodes(Node contextNode, String xPathFragment)

private NodeList
private NodeList
selectElementNodes(Node contextNode, String xPathFragment)

public NodeList

Returns:

a list of nodes matching the XPath statement
selectNodes
(Node
the node relative to which the XPath statement will be executed
contextNode
,
String[] xPathFragments)

Execute the XPath statement relative to the context node.

private NodeList
selectNodes(Node contextNode, String[] xPathFragments, int index)

private Node
selectSingleAttribute(Node contextNode, String xPathFragment)

private Node
selectSingleElement(Node contextNode, String xPathFragment)

public Node

Returns:

the first node located matching the XPath statement
selectSingleNode
(Node
the node relative to which the XPath statement will be executed
contextNode
,
String[] xPathFragments)

Execute the XPath statement relative to the context node.

private Node
selectSingleNode(Node contextNode, String[] xPathFragments, int index)

private Node
selectSingleText(Node contextNode)

private NodeList
selectTextNodes(Node contextNode)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

ALL_CHILDRENback to summary
private static final String ALL_CHILDREN
ATTRIBUTEback to summary
private static final String ATTRIBUTE
instanceback to summary
private static XPathEngine instance
NAMESPACE_URIback to summary
private static final String NAMESPACE_URI
OLD_NAMESPACE_URIback to summary
private static final String OLD_NAMESPACE_URI
TEXTback to summary
private static final String TEXT

Constructor Detail

XPathEngineback to summary
private XPathEngine()

Method Detail

getInstanceback to summary
public static XPathEngine getInstance()

Return the XPathEngine singleton.

getNodesback to summary
private NodeList getNodes(Node contextNode, String xPathFragment)
getSingleNodeback to summary
private Node getSingleNode(Node contextNode, String xPathFragment)
sameNameback to summary
private boolean sameName(Node node, String name)
sameNamespaceURIback to summary
private boolean sameNamespaceURI(Node node, String namespaceURI)
selectAttributeNodesback to summary
private NodeList selectAttributeNodes(Node contextNode, String xPathFragment)
selectChildElementsback to summary
private NodeList selectChildElements(Node contextNode)
selectElementNodesback to summary
private NodeList selectElementNodes(Node contextNode, String xPathFragment)
selectNodesback to summary
public NodeList selectNodes(Node contextNode, String[] xPathFragments)

Execute the XPath statement relative to the context node.

Parameters
contextNode:Node

the node relative to which the XPath statement will be executed

Returns:NodeList

a list of nodes matching the XPath statement

selectNodesback to summary
private NodeList selectNodes(Node contextNode, String[] xPathFragments, int index)
selectSingleAttributeback to summary
private Node selectSingleAttribute(Node contextNode, String xPathFragment)
selectSingleElementback to summary
private Node selectSingleElement(Node contextNode, String xPathFragment)
selectSingleNodeback to summary
public Node selectSingleNode(Node contextNode, String[] xPathFragments)

Execute the XPath statement relative to the context node.

Parameters
contextNode:Node

the node relative to which the XPath statement will be executed

Returns:Node

the first node located matching the XPath statement

selectSingleNodeback to summary
private Node selectSingleNode(Node contextNode, String[] xPathFragments, int index)
selectSingleTextback to summary
private Node selectSingleText(Node contextNode)
selectTextNodesback to summary
private NodeList selectTextNodes(Node contextNode)