public final class Filters
extends java.lang.Object
Filters that match non-core classes (Boolean, Object, etc.) are all prefixed with the letter 'f' (for filter).
The Filter returned by fpassthrough()
is not really a filter in the
sense that it will never filter anything out - everything matches. This can
be useful to accomplish some tasks, for example the JDOM XPath API uses it
extensively.
Modifier and Type | Method and Description |
---|---|
static Filter<Attribute> |
attribute()
Return a Filter that matches any
Attribute data. |
static Filter<Attribute> |
attribute(Namespace ns)
Return a Filter that matches any
Attribute data with the
specified namespace. |
static Filter<Attribute> |
attribute(java.lang.String name)
Return a Filter that matches any
Attribute data with the
specified name. |
static Filter<Attribute> |
attribute(java.lang.String name,
Namespace ns)
Return a Filter that matches any
Attribute data with the
specified name and namespace. |
static Filter<CDATA> |
cdata()
Return a Filter that matches any
CDATA data. |
static Filter<Comment> |
comment()
Return a Filter that matches any
Comment data. |
static Filter<Content> |
content()
Return a Filter that matches any
Content data. |
static Filter<DocType> |
doctype()
Return a Filter that matches any
DocType data. |
static Filter<Document> |
document()
Return a Filter that matches any
Document data. |
static Filter<Element> |
element()
Return a Filter that matches any
Element data. |
static Filter<Element> |
element(Namespace ns)
Return a Filter that matches any
Element data with the specified
Namespace. |
static Filter<Element> |
element(java.lang.String name)
Return a Filter that matches any
Element data with the specified
name. |
static Filter<Element> |
element(java.lang.String name,
Namespace ns)
Return a Filter that matches any
Element data with the specified
name and Namespace. |
static Filter<EntityRef> |
entityref()
Return a Filter that matches any
EntityRef data. |
static Filter<java.lang.Boolean> |
fboolean()
Return a Filter that matches any Boolean data.
|
static <F> Filter<F> |
fclass(java.lang.Class<F> clazz)
Return a Filter that matches any data of the specified Class.
|
static Filter<java.lang.Double> |
fdouble()
Return a Filter that matches any Double data.
|
static Filter<java.lang.Object> |
fpassthrough()
Return a filter that does no filtering at all - everything matches.
|
static Filter<java.lang.String> |
fstring()
Return a Filter that matches any String data.
|
static Filter<ProcessingInstruction> |
processinginstruction()
Return a Filter that matches any
ProcessingInstruction data. |
static Filter<Text> |
text()
|
static Filter<Text> |
textOnly()
|
public static final Filter<Content> content()
Content
data.Content
data.public static final Filter<Attribute> attribute()
Attribute
data.Attribute
data.public static final Filter<Attribute> attribute(java.lang.String name)
Attribute
data with the
specified name.name
- The name for all the Attributes to have (these can be in any
Namespace).Attribute
data with the
specified name.public static final Filter<Attribute> attribute(java.lang.String name, Namespace ns)
Attribute
data with the
specified name and namespace.name
- The name for all the Attributes to have.ns
- The Namespace for all the Attributes to have.Attribute
data with the
specified name and namespace.public static final Filter<Attribute> attribute(Namespace ns)
Attribute
data with the
specified namespace.ns
- The Namespace for all the Attributes to have.Attribute
data with the
specified namespace.public static final Filter<Comment> comment()
Comment
data.Comment
data.public static final Filter<CDATA> cdata()
CDATA
data.CDATA
data.public static final Filter<DocType> doctype()
DocType
data.DocType
data.public static final Filter<EntityRef> entityref()
EntityRef
data.EntityRef
data.public static final Filter<Element> element()
Element
data.Element
data.public static final Filter<Document> document()
Document
data.Document
data.public static final Filter<Element> element(java.lang.String name)
Element
data with the specified
name.name
- The name of Elements to match.Element
data with the specified
name.public static final Filter<Element> element(java.lang.String name, Namespace ns)
Element
data with the specified
name and Namespace.name
- The name of Elements to match.ns
- The Namespace to matchElement
data with the specified
name and Namespace.public static final Filter<Element> element(Namespace ns)
Element
data with the specified
Namespace.ns
- The Namespace to matchElement
data with the specified
Namespace.public static final Filter<ProcessingInstruction> processinginstruction()
ProcessingInstruction
data.ProcessingInstruction
data.public static final Filter<java.lang.Boolean> fboolean()
public static final Filter<java.lang.String> fstring()
public static final Filter<java.lang.Double> fdouble()
public static final <F> Filter<F> fclass(java.lang.Class<F> clazz)
F
- The generic type of the content returned by this Filterclazz
- the Class type to match in the filterpublic static final Filter<java.lang.Object> fpassthrough()
Copyright © 2021 Jason Hunter, Brett McLaughlin. All Rights Reserved.