Top Description Fields Constructors Methods
org.jdom2.filter

public Class AttributeFilter

extends AbstractFilter<Attribute>
Class Inheritance
Imports
org.jdom2.Attribute, .Namespace

A Filter that only matches org.jdom2.Attribute objects.
Author
Rolf Lear

Field Summary

Modifier and TypeField and Description
private final String
name

The element name

private final Namespace
namespace

The element namespace

private static final long
serialVersionUID

Hides org.jdom2.filter.AbstractFilter.serialVersionUID.

JDOM2 Serialization: Default mechanism

Constructor Summary

AccessConstructor and Description
public
AttributeFilter()

Select only the Elements.

public
AttributeFilter(String
The name of the Element.
name
)

Select only the Elements with the supplied name in any Namespace.

public
AttributeFilter(Namespace
The namespace the Attribute lives in.
namespace
)

Select only the Attributes with the supplied Namespace.

public
AttributeFilter(String
The name of the Attribute.
name
,
Namespace
The namespace the Attribute lives in.
namespace
)

Select only the Attributes with the supplied name and Namespace.

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

whether the two filters are equal
equals
(Object
the object to compare against
obj
)

Overrides java.lang.Object.equals.

Returns whether the two filters are equivalent (i.e. the matching names and namespace are equivalent).
public Attribute

Returns:

true if the objected matched a predfined set of rules.
filter
(Object
The Content to verify.
content
)

Implements org.jdom2.filter.Filter.filter.

Check to see if the Content matches a predefined set of rules.
public int
hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code value for the object.
Inherited from org.jdom2.filter.AbstractFilter:
andfiltermatchesnegateorrefine

Field Detail

nameback to summary
private final String name

The element name

namespaceback to summary
private final Namespace namespace

The element namespace

serialVersionUIDback to summary
private static final long serialVersionUID

Hides org.jdom2.filter.AbstractFilter.serialVersionUID.

JDOM2 Serialization: Default mechanism

Constructor Detail

AttributeFilterback to summary
public AttributeFilter()

Select only the Elements.

AttributeFilterback to summary
public AttributeFilter(String name)

Select only the Elements with the supplied name in any Namespace.

Parameters
name:String

The name of the Element.

AttributeFilterback to summary
public AttributeFilter(Namespace namespace)

Select only the Attributes with the supplied Namespace.

Parameters
namespace:Namespace

The namespace the Attribute lives in.

AttributeFilterback to summary
public AttributeFilter(String name, Namespace namespace)

Select only the Attributes with the supplied name and Namespace.

Parameters
name:String

The name of the Attribute.

namespace:Namespace

The namespace the Attribute lives in.

Method Detail

equalsback to summary
public boolean equals(Object obj)

Overrides java.lang.Object.equals.

Returns whether the two filters are equivalent (i.e. the matching names and namespace are equivalent).

Parameters
obj:Object

the object to compare against

Returns:boolean

whether the two filters are equal

Annotations
@Override
filterback to summary
public Attribute filter(Object content)

Implements org.jdom2.filter.Filter.filter.

Check to see if the Content matches a predefined set of rules.

Parameters
content:Object

The Content to verify.

Returns:Attribute

true if the objected matched a predfined set of rules.

Annotations
@Override
hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Doc from java.lang.Object.hashCode.

Returns a hash code value for the object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
Returns:int

a hash code value for this object.

Annotations
@Override