Module org.eclipse.persistence.sdo
Class XPathHelper
java.lang.Object
org.eclipse.persistence.sdo.helper.extension.XPathHelper
This singleton provides support for querying DataObjects
via xpath expression where the result is a List containing
one or more simple types or DataObjects.
-
Nested Class Summary
Modifier and TypeClassDescriptionclass
A QueryPart knows the name of the property to be queried against on a given DataObject, as well as the value to be used in the comparison. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected List
addResultsToList
(Object obj, List results) Convenience method that will add the provided object to the 'results' list if the object is non-null.evaluate
(String expression, DataObject dataObject) Evaluate an XPath expression in the specified context and return a List containing any types or DataObjects that match the search criteria.static XPathHelper
Returns the one and only instance of this singleton.protected String
getPathWithAtRemoved
(String expression) Convenience method that strips off '@' portion, if one exists.protected String
getPathWithPrefixRemoved
(String expression) Convenience method that strips off 'ns0:' portion, if one exists.prepareExpression
(String expression) Create and return an XPathExpression, using the provided string to create the expression.protected boolean
shouldCallXPathEngine
(String expression) Convenience method for determining if XPathEngine should be called, i.e.
-
Constructor Details
-
XPathHelper
public XPathHelper()
-
-
Method Details
-
getInstance
Returns the one and only instance of this singleton. -
prepareExpression
Create and return an XPathExpression, using the provided string to create the expression.- Parameters:
expression
-- Returns:
-
evaluate
Evaluate an XPath expression in the specified context and return a List containing any types or DataObjects that match the search criteria.- Parameters:
expression
-dataObject
-- Returns:
- List containing zero or more entries
-
addResultsToList
Convenience method that will add the provided object to the 'results' list if the object is non-null. If the object represents a list, each non-null entry will be added to the results list.- Parameters:
obj
-results
-- Returns:
-
getPathWithAtRemoved
Convenience method that strips off '@' portion, if one exists.- Parameters:
expression
-- Returns:
-
getPathWithPrefixRemoved
Convenience method that strips off 'ns0:' portion, if one exists.- Parameters:
expression
-- Returns:
-
shouldCallXPathEngine
Convenience method for determining if XPathEngine should be called, i.e. the XPath expression contains functionality not yet supported.- Parameters:
expression
-- Returns:
-