public class XPathFilter extends MaskFilter
XPathFilter has an accept(Content)
method, which returns true,
if the recursive XPath, when matched against the Content node, returns a
non-empty list of Content results. The recursive XPath is created from
the predicate query pattern, from which the enclosing square brackets have
been stripped away.
Modifier and Type | Field and Description |
---|---|
private XPath |
xpath
The nested XPath query, which is used to match against the context
node.
|
mask
ALLCONTENT, NAMENODES, PARENTNODES, PROPERTYNODES, VALUENODES, XPATHNODES, XPATHTEXT
Constructor and Description |
---|
XPathFilter()
Creates an XPathFilter that will accept any accessible XPath child
node.
|
XPathFilter(java.lang.String pattern)
Creates an XPathFilter using the supplied query pattern.
|
Modifier and Type | Method and Description |
---|---|
boolean |
accept(Content node)
Reports whether a given Content node is accepted by this XPathFilter.
|
java.lang.String |
toString()
Prints a pretty representation of this Filter.
|
getMask
and, andIndexFilter, andNodeFilter, not, or, orNodeFilter
private XPath xpath
public XPathFilter()
public XPathFilter(java.lang.String pattern)
pattern
- an XPath query pattern.public boolean accept(Content node)
accept
in class MaskFilter
node
- any Content.