public class XPathUtil extends Object
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.
Modifier and Type | Class and Description |
---|---|
static class |
XPathUtil.Step |
static class |
XPathUtil.StepList |
Constructor and Description |
---|
XPathUtil() |
Modifier and Type | Method and Description |
---|---|
static boolean |
equals(Name targetNodeName,
XPathUtil.StepList targetXPath) |
static XPathUtil.StepList |
rootElementSteps(AttributeDescriptor rootElement,
NamespaceSupport namespaces)
Returns the list of steps in an x-path expression that represents the root element.
|
static XPathUtil.StepList |
steps(AttributeDescriptor root,
String xpathExpression,
NamespaceSupport namespaces)
Returns the list of stepts in
xpathExpression by cleaning it up removing
unnecessary elements. |
public static XPathUtil.StepList rootElementSteps(AttributeDescriptor rootElement, NamespaceSupport namespaces) throws IllegalArgumentException
root
- non null descriptor of the root attribute, generally the Feature descriptor.namespaces
- namespace support for generating qnames from namespaces.IllegalArgumentException
- if root
is undefined.public static XPathUtil.StepList steps(AttributeDescriptor root, String xpathExpression, NamespaceSupport namespaces) throws IllegalArgumentException
xpathExpression
by cleaning it up removing
unnecessary elements.
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.xpathExpression
- IllegalArgumentException
- if xpathExpression
has no steps or it isn't a
valid XPath expression against type
.public static boolean equals(Name targetNodeName, XPathUtil.StepList targetXPath)
Copyright © 1996–2019 Geotools. All rights reserved.