|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ObjectFilter
public class Filter
The Filter class is a JavaBean that abstractly represents the data needed to calculate a filter
for a data set. A filter consists of some String
expression, a FilterOperation
and a filter value. The mechanism for applying a filter to a data set is not provided here.
The filter expression is used to abstractly name some part of a data set to filter. The filter operation
is used to describe the operation to use when performing filtering. The set of operations for
available for use should be related to a subclass of the Filter type; there are no implicitly
defined operations. The filter value is used to describe how to filter a given filter expression.
For example, in an application performing filtering using SQL, a filter expression pet
with a filter operation mapping to "equals" and a filter value of "dog" could be transformed
into a SQL WHERE fragment as:
WHERE pet = 'dog'The Filter class simply provides an abstraction for a filter's metadata; the mechanism for performing this transformation from Filter instance to SQL fragment is not provided here.
In addition to the fundamental data fora Filter, two additional properties can be defined. The
FilterOperationHint
property can
be used to reference a class of operation related to the hint. The
FilterTypeHint
property
defines a hint for the type of data associated with the Filter's filter expression. This data can be
used to handle quoting and type conversion for a given filter value. In the example above, a type hint of
a FilterTypeHint.STRING
can be used
when constructing the SQL fragment in order to perform the correct quoting of the filter value.
Constructor Summary | |
---|---|
Filter()
|
Method Summary | |
---|---|
String |
getFilterExpression()
Get the filter expression for this filter |
FilterOperation |
getOperation()
Get the filter operation for this filter |
FilterOperationHint |
getOperationHint()
Get the operation hint for this filter |
FilterTypeHint |
getTypeHint()
Get the type hint for this filter. |
Object |
getValue()
Get the value for this filter. |
void |
setFilterExpression(String filterExpression)
Set the filter expression for this filter |
void |
setOperation(FilterOperation filterOperation)
Set the filter operation for this filter |
void |
setOperationHint(FilterOperationHint filterOperationHint)
Set the operation hint for this filter |
void |
setTypeHint(FilterTypeHint typeHint)
Set the type hint for this filter |
void |
setValue(Object value)
Set the value for this filter. |
Methods inherited from class Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Filter()
Method Detail |
---|
public FilterTypeHint getTypeHint()
public void setTypeHint(FilterTypeHint typeHint)
typeHint
- the filter type hintpublic void setFilterExpression(String filterExpression)
filterExpression
- the filter expressionpublic String getFilterExpression()
public void setOperation(FilterOperation filterOperation)
filterOperation
- the filter operationpublic FilterOperation getOperation()
public FilterOperationHint getOperationHint()
public void setOperationHint(FilterOperationHint filterOperationHint)
filterOperationHint
- the filter operation hintpublic void setValue(Object value)
value
must implement Serializable
.
value
- the valuepublic Object getValue()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |