Package org.jdom2.filter
Class ElementFilter
- java.lang.Object
-
- org.jdom2.filter.AbstractFilter<Element>
-
- org.jdom2.filter.ElementFilter
-
public class ElementFilter extends AbstractFilter<Element>
A Filter that only matchesElementobjects.- Author:
- Jools Enticknap, Bradley S. Huffman
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ElementFilter()Select only the Elements.ElementFilter(java.lang.String name)Select only the Elements with the supplied name in any Namespace.ElementFilter(java.lang.String name, Namespace namespace)Select only the Elements with the supplied name and Namespace.ElementFilter(Namespace namespace)Select only the Elements with the supplied Namespace.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)Returns whether the two filters are equivalent (i.e. the matching names and namespace are equivalent).Elementfilter(java.lang.Object content)Check to see if the object matches a predefined set of rules.inthashCode()java.lang.StringtoString()
-
-
-
Constructor Detail
-
ElementFilter
public ElementFilter()
Select only the Elements.
-
ElementFilter
public ElementFilter(java.lang.String name)
Select only the Elements with the supplied name in any Namespace.- Parameters:
name- The name of the Element.
-
ElementFilter
public ElementFilter(Namespace namespace)
Select only the Elements with the supplied Namespace.- Parameters:
namespace- The namespace the Element lives in.
-
ElementFilter
public ElementFilter(java.lang.String name, Namespace namespace)Select only the Elements with the supplied name and Namespace.- Parameters:
name- The name of the Element.namespace- The namespace the Element lives in.
-
-
Method Detail
-
filter
public Element filter(java.lang.Object content)
Check to see if the object matches a predefined set of rules.- Parameters:
content- The object to verify.- Returns:
trueif the objected matched a predfined set of rules.
-
equals
public boolean equals(java.lang.Object obj)
Returns whether the two filters are equivalent (i.e. the matching names and namespace are equivalent).- Overrides:
equalsin classjava.lang.Object- Parameters:
obj- the object to compare against- Returns:
- whether the two filters are equal
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-