Package org.jdom.filter
Class Filters
- java.lang.Object
-
- org.jdom.filter.Filters
-
public final class Filters extends Object
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.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Filter<CDATA>
cdata()
Return a Filter that matches anyCDATA
data.static Filter<Comment>
comment()
Return a Filter that matches anyComment
data.static Filter<Content>
content()
Return a Filter that matches anyContent
data.static Filter<DocType>
doctype()
Return a Filter that matches anyDocType
data.static Filter<Element>
element()
Return a Filter that matches anyElement
data.static Filter<Element>
element(String name)
Return a Filter that matches anyElement
data with the specified name.static Filter<Element>
element(String name, Namespace ns)
Return a Filter that matches anyElement
data with the specified name and Namespace.static Filter<Element>
element(Namespace ns)
Return a Filter that matches anyElement
data with the specified Namespace.static Filter<EntityRef>
entityref()
Return a Filter that matches anyEntityRef
data.static Filter<ProcessingInstruction>
processinginstruction()
Return a Filter that matches anyProcessingInstruction
data.static Filter<Text>
text()
static Filter<Text>
textOnly()
-
-
-
Method Detail
-
content
public static final Filter<Content> content()
Return a Filter that matches anyContent
data.- Returns:
- a Filter that matches any
Content
data.
-
comment
public static final Filter<Comment> comment()
Return a Filter that matches anyComment
data.- Returns:
- a Filter that matches any
Comment
data.
-
cdata
public static final Filter<CDATA> cdata()
Return a Filter that matches anyCDATA
data.- Returns:
- a Filter that matches any
CDATA
data.
-
doctype
public static final Filter<DocType> doctype()
Return a Filter that matches anyDocType
data.- Returns:
- a Filter that matches any
DocType
data.
-
entityref
public static final Filter<EntityRef> entityref()
Return a Filter that matches anyEntityRef
data.- Returns:
- a Filter that matches any
EntityRef
data.
-
element
public static final Filter<Element> element()
Return a Filter that matches anyElement
data.- Returns:
- a Filter that matches any
Element
data.
-
element
public static final Filter<Element> element(String name)
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
public static final Filter<Element> element(String name, Namespace ns)
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
public static final Filter<Element> element(Namespace ns)
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
public static final Filter<ProcessingInstruction> processinginstruction()
Return a Filter that matches anyProcessingInstruction
data.- Returns:
- a Filter that matches any
ProcessingInstruction
data.
-
-