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 anyCDATAdata.static Filter<Comment>comment()Return a Filter that matches anyCommentdata.static Filter<Content>content()Return a Filter that matches anyContentdata.static Filter<DocType>doctype()Return a Filter that matches anyDocTypedata.static Filter<Element>element()Return a Filter that matches anyElementdata.static Filter<Element>element(String name)Return a Filter that matches anyElementdata with the specified name.static Filter<Element>element(String name, Namespace ns)Return a Filter that matches anyElementdata with the specified name and Namespace.static Filter<Element>element(Namespace ns)Return a Filter that matches anyElementdata with the specified Namespace.static Filter<EntityRef>entityref()Return a Filter that matches anyEntityRefdata.static Filter<ProcessingInstruction>processinginstruction()Return a Filter that matches anyProcessingInstructiondata.static Filter<Text>text()static Filter<Text>textOnly()
-
-
-
Method Detail
-
content
public static final Filter<Content> content()
Return a Filter that matches anyContentdata.- Returns:
- a Filter that matches any
Contentdata.
-
comment
public static final Filter<Comment> comment()
Return a Filter that matches anyCommentdata.- Returns:
- a Filter that matches any
Commentdata.
-
cdata
public static final Filter<CDATA> cdata()
Return a Filter that matches anyCDATAdata.- Returns:
- a Filter that matches any
CDATAdata.
-
doctype
public static final Filter<DocType> doctype()
Return a Filter that matches anyDocTypedata.- Returns:
- a Filter that matches any
DocTypedata.
-
entityref
public static final Filter<EntityRef> entityref()
Return a Filter that matches anyEntityRefdata.- Returns:
- a Filter that matches any
EntityRefdata.
-
element
public static final Filter<Element> element()
Return a Filter that matches anyElementdata.- Returns:
- a Filter that matches any
Elementdata.
-
element
public static final Filter<Element> element(String name)
Return a Filter that matches anyElementdata with the specified name.- Parameters:
name- The name of Elements to match.- Returns:
- a Filter that matches any
Elementdata with the specified name.
-
element
public static final Filter<Element> element(String name, Namespace ns)
Return a Filter that matches anyElementdata 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
Elementdata with the specified name and Namespace.
-
element
public static final Filter<Element> element(Namespace ns)
Return a Filter that matches anyElementdata with the specified Namespace.- Parameters:
ns- The Namespace to match- Returns:
- a Filter that matches any
Elementdata with the specified Namespace.
-
processinginstruction
public static final Filter<ProcessingInstruction> processinginstruction()
Return a Filter that matches anyProcessingInstructiondata.- Returns:
- a Filter that matches any
ProcessingInstructiondata.
-
-