public class XPathMatcher extends ArrayList<XPathElementMatcher>
modCount
Constructor and Description |
---|
XPathMatcher(String xpathExpression)
Constructor of XPath Matcher with a XPath expression.
|
Modifier and Type | Method and Description |
---|---|
protected XPathAttributeMatcher |
createAttributeMatcher(XPathElementMatcher elementmatcher,
String attrName,
String attrValue)
Create XPath attribute matcher.
|
protected XPathElementMatcher |
createElementMatcher()
Create XPath any element matcher.
|
protected XPathElementMatcher |
createElementMatcher(String prefix,
String localName)
Create XPath element matcher.
|
int |
getNbWildCard()
Returns the number of wilcard used in the XPath expression and -1 if there is
no wildcard.
|
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 createElementMatcher(String prefix, String localName)
elementName
- protected XPathElementMatcher createElementMatcher()
protected XPathAttributeMatcher createAttributeMatcher(XPathElementMatcher elementmatcher, String attrName, String attrValue)
elementmatcher
- attrName
- attrValue
- Copyright © 2020. All rights reserved.