Package org.jdom2.filter
Class Filters
java.lang.Object
org.jdom2.filter.Filters
Factory class of convenience methods to create Filter instances of common
types. Methods that return Filters that act on core JDOM classes (Element,
Text, etc.) are simply named after the content they return.
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.
- Author:
- Rolf Lear
-
Method Summary
Modifier and TypeMethodDescriptionReturn a Filter that matches anyAttribute
data.Return a Filter that matches anyAttribute
data with the specified name.Return a Filter that matches anyAttribute
data with the specified name and namespace.Return a Filter that matches anyAttribute
data with the specified namespace.cdata()
Return a Filter that matches anyCDATA
data.comment()
Return a Filter that matches anyComment
data.content()
Return a Filter that matches anyContent
data.doctype()
Return a Filter that matches anyDocType
data.document()
Return a Filter that matches anyDocument
data.element()
Return a Filter that matches anyElement
data.Return a Filter that matches anyElement
data with the specified name.Return a Filter that matches anyElement
data with the specified name and Namespace.Return a Filter that matches anyElement
data with the specified Namespace.Return a Filter that matches anyEntityRef
data.fboolean()
Return a Filter that matches any Boolean data.static final <F> Filter
<F> Return a Filter that matches any data of the specified Class.fdouble()
Return a Filter that matches any Double data.Return a filter that does no filtering at all - everything matches.fstring()
Return a Filter that matches any String data.static final Filter
<ProcessingInstruction> Return a Filter that matches anyProcessingInstruction
data.text()
textOnly()
-
Method Details
-
content
Return a Filter that matches anyContent
data.- Returns:
- a Filter that matches any
Content
data.
-
attribute
Return a Filter that matches anyAttribute
data.- Returns:
- a Filter that matches any
Attribute
data.
-
attribute
Return a Filter that matches anyAttribute
data with the specified name.- Parameters:
name
- The name for all the Attributes to have (these can be in any Namespace).- Returns:
- a Filter that matches any
Attribute
data with the specified name.
-
attribute
Return a Filter that matches anyAttribute
data with the specified name and namespace.- Parameters:
name
- The name for all the Attributes to have.ns
- The Namespace for all the Attributes to have.- Returns:
- a Filter that matches any
Attribute
data with the specified name and namespace.
-
attribute
Return a Filter that matches anyAttribute
data with the specified namespace.- Parameters:
ns
- The Namespace for all the Attributes to have.- Returns:
- a Filter that matches any
Attribute
data with the specified namespace.
-
comment
Return a Filter that matches anyComment
data.- Returns:
- a Filter that matches any
Comment
data.
-
cdata
Return a Filter that matches anyCDATA
data.- Returns:
- a Filter that matches any
CDATA
data.
-
doctype
Return a Filter that matches anyDocType
data.- Returns:
- a Filter that matches any
DocType
data.
-
entityref
Return a Filter that matches anyEntityRef
data.- Returns:
- a Filter that matches any
EntityRef
data.
-
element
Return a Filter that matches anyElement
data.- Returns:
- a Filter that matches any
Element
data.
-
document
Return a Filter that matches anyDocument
data.- Returns:
- a Filter that matches any
Document
data.
-
element
Return a Filter that matches anyElement
data with the specified name.- Parameters:
name
- The name of Elements to match.- Returns:
- a Filter that matches any
Element
data with the specified name.
-
element
Return a Filter that matches anyElement
data with the specified name and Namespace.- Parameters:
name
- The name of Elements to match.ns
- The Namespace to match- Returns:
- a Filter that matches any
Element
data with the specified name and Namespace.
-
element
Return a Filter that matches anyElement
data with the specified Namespace.- Parameters:
ns
- The Namespace to match- Returns:
- a Filter that matches any
Element
data with the specified Namespace.
-
processinginstruction
Return a Filter that matches anyProcessingInstruction
data.- Returns:
- a Filter that matches any
ProcessingInstruction
data.
-
text
-
textOnly
-
fboolean
Return a Filter that matches any Boolean data.- Returns:
- a Filter that matches any Boolean data.
-
fstring
Return a Filter that matches any String data.- Returns:
- a Filter that matches any String data.
-
fdouble
Return a Filter that matches any Double data.- Returns:
- a Filter that matches any Double data.
-
fclass
Return a Filter that matches any data of the specified Class.- Type Parameters:
F
- The generic type of the content returned by this Filter- Parameters:
clazz
- the Class type to match in the filter- Returns:
- a Filter that matches any data of the specified Class.
-
fpassthrough
Return a filter that does no filtering at all - everything matches.- Returns:
- A Pass-Through Filter.
-