Package org.openrewrite.xml
Class XPathMatcher
java.lang.Object
org.openrewrite.xml.XPathMatcher
Supports a limited set of XPath expressions, specifically those documented on this page.
Additionally, supports `local-name()` and `namespace-uri()` conditions, `and`/`or` operators, and chained conditions.
Used for checking whether a visitor's cursor meets a certain XPath expression.
The "current node" for XPath evaluation is always the root node of the document. As a result, '.' and '..' are not recognized.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanmatches(org.openrewrite.Cursor cursor) Checks if the given XPath expression matches the provided cursor.
-
Constructor Details
-
XPathMatcher
-
-
Method Details
-
matches
public boolean matches(org.openrewrite.Cursor cursor) Checks if the given XPath expression matches the provided cursor.- Parameters:
cursor- the cursor representing the XML document- Returns:
- true if the expression matches the cursor, false otherwise
-