|
Filters |
Top Previous Next |
The filtering is performed by special objects, called Filters.
A filter decides whether to let an object pass through its filtering rules with the method:
public boolean accept(Object o);
, which will return true if the object matched and should not be filtered out, false otherwise.
The abstract Filter class also includes two generic methods:
public void setFilterPattern(Object filter);
public Object getFilterPattern();
, that can be used for assigning and retrieving the given filter pattern as an arbitrary java object.
The behaviour of the filter when dealing with null values is also specified with the methods:
public boolean getAcceptNull();
public void setAcceptNull(boolean acceptNull);
We have implemented filters for all the common objects:
StringFilter: for Strings.
BooleanFilter: for Boolean values.
DateFilter: for Dates.
NumericFilter: for Numbers.
You can create your own filter by extends the abstract Filter class.