public class XPathMatcher extends ArrayList<IXPathNodeMatcher>
modCount
Constructor and Description |
---|
XPathMatcher(String xpathExpression)
Constructor of XPath Matcher with a XPath expression.
|
Modifier and Type | Method and Description |
---|---|
protected XPathElementMatcher |
createAnyElementMatcher()
Create XPath any element matcher.
|
protected XPathAttributeMatcher |
createAttributeMatcher(XPathElementMatcher elementmatcher,
String attrName,
String attrValue)
Create the XPath attribute matcher.
|
int |
getNbWildCard()
Returns the number of wilcard used in the XPath expression and -1 if there is
no wildcard.
|
IXPathNodeMatcher.MatcherType |
getNodeSelectorType()
Returns the type (element, attribute, text) of the node to select.
|
List<String> |
getWildcardValues(Node selectedNode)
Returns list of wildcard values of the given DOM Node.
|
boolean |
match(Node node)
Returns true if the given DOM Node match the XPath expression of this XPath
matcher and false otherwise.
|
boolean |
match(Node node,
Collection<String> wildcardValues)
Returns true if the given DOM Node match the XPath expression of this XPath
matcher and false otherwise.
|
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, forEach, get, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeIf, removeRange, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSize
equals, hashCode
containsAll, toString
finalize, getClass, notify, notifyAll, wait, wait, wait
containsAll, equals, hashCode
parallelStream, stream
public XPathMatcher(String xpathExpression)
xpathExpression
- public boolean match(Node node)
node
- the DOM Node to match.public boolean match(Node node, Collection<String> wildcardValues)
node
- the DOM Node to match.wildcardValues
- the list of wildcard values and null otherwise.public List<String> getWildcardValues(Node selectedNode)
selectedNode
- public int getNbWildCard()
protected XPathElementMatcher createAnyElementMatcher()
protected XPathAttributeMatcher createAttributeMatcher(XPathElementMatcher elementmatcher, String attrName, String attrValue)
elementmatcher
- the parent element matcher.attrName
- the attribute name to match.attrValue
- the attribute value to match.public IXPathNodeMatcher.MatcherType getNodeSelectorType()
Copyright © 2021. All rights reserved.