Package org.apache.tika.sax.xpath
Class Matcher
java.lang.Object
org.apache.tika.sax.xpath.Matcher
- Direct Known Subclasses:
AttributeMatcher
,ChildMatcher
,CompositeMatcher
,ElementMatcher
,NamedAttributeMatcher
,NodeMatcher
,SubtreeMatcher
,TextMatcher
XPath element matcher. A matcher instance encapsulates a specific
state in XPath evaluation.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionReturns the XPath evaluation state that results from descending to a child element with the given name.boolean
matchesAttribute
(String namespace, String name) Returnstrue
if the XPath expression matches the named attribute of the element associated with this evaluation state.boolean
Returnstrue
if the XPath expression matches the element associated with this evaluation state.boolean
Returnstrue
if the XPath expression matches all text nodes whose parent is the element associated with this evaluation state.
-
Field Details
-
FAIL
State of a failed XPath evaluation, where nothing is matched. This matcher instance is used as a sentinel object whenever an XPath evaluation branch fails.
-
-
Constructor Details
-
Matcher
public Matcher()
-
-
Method Details
-
descend
Returns the XPath evaluation state that results from descending to a child element with the given name.- Parameters:
namespace
- element namespace ornull
name
- element name- Returns:
- next XPath evaluation state
-
matchesElement
public boolean matchesElement()Returnstrue
if the XPath expression matches the element associated with this evaluation state.- Returns:
- XPath evaluation state for this element
-
matchesAttribute
Returnstrue
if the XPath expression matches the named attribute of the element associated with this evaluation state.- Parameters:
namespace
- attribute namespace ornull
name
- attribute name- Returns:
- XPath evaluation state for named attribute of this element
-
matchesText
public boolean matchesText()Returnstrue
if the XPath expression matches all text nodes whose parent is the element associated with this evaluation state.- Returns:
- XPath evaluation state for text children of this element
-