org.jdom.filter
Class ElementFilter

java.lang.Object
  |
  +--org.jdom.filter.ElementFilter
All Implemented Interfaces:
Filter

public class ElementFilter
extends java.lang.Object
implements Filter

The ElementFilter when applied to a FilterList will only allow Elements to be visible.

Version:
$Revision: 1.8 $, $Date: 2003/04/02 01:56:58 $
Author:
Jools Enticknap, Bradley S. Huffman

Field Summary
protected  java.lang.String name
          The element name
protected  Namespace namespace
          The element namespace
 
Constructor Summary
ElementFilter()
          Select only the Elements.
ElementFilter(Namespace namespace)
          Select only the Elements with the supplied Namespace.
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.
 
Method Summary
 boolean equals(java.lang.Object obj)
          Returns true if object is instance of ElementFilter and has the same parent Element, name, and namespace as this filter.
 boolean matches(java.lang.Object obj)
          Check to see if the object matches a predefined set of rules.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

name

protected java.lang.String name
The element name


namespace

protected Namespace namespace
The element namespace

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

matches

public boolean matches(java.lang.Object obj)
Check to see if the object matches a predefined set of rules.

Specified by:
matches in interface Filter
Parameters:
obj - The object to verify.
Returns:
true if the objected matched a predfined set of rules.

equals

public boolean equals(java.lang.Object obj)
Returns true if object is instance of ElementFilter and has the same parent Element, name, and namespace as this filter.

Overrides:
equals in class java.lang.Object
Returns:
true if the Filters are equal


Copyright © 2003 Jason Hunter, Brett McLaughlin. All Rights Reserved.