Package org.geotools.data.complex.util
Class XPathUtil
- Object
-
- XPathUtil
-
- Direct Known Subclasses:
XPath
public class XPathUtil extends Object
Utility class to evaluate XPath expressions against an Attribute instance, which may be any Attribute, whether it is simple, complex, a feature, etc.At the difference of the Filter subsystem, which works against Attribute contents (for example to evaluate a comparison filter), the XPath subsystem, for which this class is the single entry point, works against Attribute instances. That is, the result of an XPath expression, if a single value, is an Attribtue, not the attribute content, or a List of Attributes, for instance.
- Author:
- Gabriel Roldan (Axios Engineering), Rini Angreani (CSIRO Earth Science and Resource Engineering)
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classXPathUtil.Stepstatic classXPathUtil.StepList
-
Constructor Summary
Constructors Constructor Description XPathUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleanequals(Name targetNodeName, XPathUtil.StepList targetXPath)static XPathUtil.StepListrootElementSteps(AttributeDescriptor rootElement, NamespaceSupport namespaces)Returns the list of steps in an x-path expression that represents the root element.static XPathUtil.StepListsteps(AttributeDescriptor root, String xpathExpression, NamespaceSupport namespaces)Returns the list of stepts inxpathExpressionby cleaning it up removing unnecessary elements.
-
-
-
Method Detail
-
rootElementSteps
public static XPathUtil.StepList rootElementSteps(AttributeDescriptor rootElement, NamespaceSupport namespaces) throws IllegalArgumentException
Returns the list of steps in an x-path expression that represents the root element.- Parameters:
rootElement- non null descriptor of the root attribute, generally the Feature descriptor.namespaces- namespace support for generating qnames from namespaces.- Returns:
- A list of unique of steps in an xpath expression.
- Throws:
IllegalArgumentException- ifrootis undefined.
-
steps
public static XPathUtil.StepList steps(AttributeDescriptor root, String xpathExpression, NamespaceSupport namespaces) throws IllegalArgumentException
Returns the list of stepts inxpathExpressionby cleaning it up removing unnecessary elements.- Parameters:
root- non null descriptor of the root attribute, generally the Feature descriptor. Used to ignore the first step in xpathExpression if the expression's first step is named as rootName.- Throws:
IllegalArgumentException- ifxpathExpressionhas no steps or it isn't a valid XPath expression againsttype.
-
equals
public static boolean equals(Name targetNodeName, XPathUtil.StepList targetXPath)
-
-