org.openfaces.component.filter
Class ExpressionFilterCriterion

java.lang.Object
  extended by org.openfaces.component.filter.FilterCriterion
      extended by org.openfaces.component.filter.ExpressionFilterCriterion
All Implemented Interfaces:
java.io.Serializable

public class ExpressionFilterCriterion
extends FilterCriterion

An expression-based filter criterion that compares a particular property (or expression) of a filtered object with the specified parameters based on the specified condition. It consists of an expression (see the getPropertyLocator() method, or a quick expression accessor getExpressionStr()), a condition (see the getCondition() method), and a list of parameters (see the getParameters() method, or convenience parameter access methods getArg1(), getArg2(), and isCaseSensitive). There's an additional inverse property that works in conjunction with property expression and inverts the result of comparison if set to true.

See Also:
Serialized Form

Constructor Summary
ExpressionFilterCriterion()
           
ExpressionFilterCriterion(ExpressionFilterCriterion criterion)
           
ExpressionFilterCriterion(FilterCondition condition, boolean inverse)
           
ExpressionFilterCriterion(java.lang.Object arg1)
           
ExpressionFilterCriterion(PropertyLocator propertyLocator, FilterCondition condition, java.lang.Object arg1)
           
 
Method Summary
 boolean acceptsAll()
           
 boolean equals(java.lang.Object o)
           
 java.lang.Object getArg1()
          Returns the first argument of this criterion.
 java.lang.Object getArg2()
          Returns the second argument of this criterion.
 FilterCondition getCondition()
          Returns the filtering condition for this criterion.
 java.lang.String getExpressionStr()
          Returns the expression string for this criterion.
 java.util.Map<java.lang.String,java.lang.Object> getParameters()
           
 PropertyLocator getPropertyLocator()
           
 int hashCode()
           
 boolean isCaseSensitive()
          Identifies whether text comparison should be performed in a case-sensitive way.
 boolean isInverse()
          Specifies whether the condition specified with the "condition" property should be treated in the opposite way.
 java.lang.Object process(FilterCriterionProcessor processor)
           
 void setArg1(java.lang.Object arg1)
           
 void setArg2(java.lang.Object arg2)
           
 void setCaseSensitive(boolean caseSensitive)
           
 void setCondition(FilterCondition condition)
           
 void setInverse(boolean inverse)
           
 void setPropertyLocator(PropertyLocator propertyLocator)
           
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExpressionFilterCriterion

public ExpressionFilterCriterion()

ExpressionFilterCriterion

public ExpressionFilterCriterion(java.lang.Object arg1)

ExpressionFilterCriterion

public ExpressionFilterCriterion(PropertyLocator propertyLocator,
                                 FilterCondition condition,
                                 java.lang.Object arg1)

ExpressionFilterCriterion

public ExpressionFilterCriterion(FilterCondition condition,
                                 boolean inverse)

ExpressionFilterCriterion

public ExpressionFilterCriterion(ExpressionFilterCriterion criterion)
Method Detail

process

public java.lang.Object process(FilterCriterionProcessor processor)
Specified by:
process in class FilterCriterion

acceptsAll

public boolean acceptsAll()
Specified by:
acceptsAll in class FilterCriterion

getPropertyLocator

public PropertyLocator getPropertyLocator()

setPropertyLocator

public void setPropertyLocator(PropertyLocator propertyLocator)

getExpressionStr

public java.lang.String getExpressionStr()
Returns the expression string for this criterion. This is essentially the expression that is specified for the filter component from which this criterion originates.

Returns:
the expression string for this criterion

getCondition

public FilterCondition getCondition()
Returns the filtering condition for this criterion. Note that the filtering condition affects the set and number of arguments that the filter criterion possesses. E.g. FilterCriterion.EQUALS and FilterCriterion.GREATER require just one argument, FilterCriterion.BETWEEN requires two arguments, and FilterCriterion.EMPTY doesn't require arguments at all.

Returns:
the filter condition for this criterion

setCondition

public void setCondition(FilterCondition condition)

getParameters

public java.util.Map<java.lang.String,java.lang.Object> getParameters()

setArg1

public void setArg1(java.lang.Object arg1)

getArg1

public java.lang.Object getArg1()
Returns the first argument of this criterion. This method is applicable when the criterion has a condition that requires one or more arguments (e.g. FilterCondition.EQUALS or FilterCondition.BETWEEN).

Returns:
the first argument of this criterion

setArg2

public void setArg2(java.lang.Object arg2)

getArg2

public java.lang.Object getArg2()
Returns the second argument of this criterion. This method is applicable when the criterion has a condition that requires two or more arguments (there's presently just one such condition -- FilterCondition.BETWEEN).

Returns:
the second argument of this criterion

isCaseSensitive

public boolean isCaseSensitive()
Identifies whether text comparison should be performed in a case-sensitive way. This parameter is applicable only when this criterion contains a condition that operates with string values (e.g. FilterCondition.CONTAINS, FilterCondition.BEGINS_WITH, or FilterCondition.EQUALS)

Returns:
true if text comparison should be performed in a case-sensitive way

setCaseSensitive

public void setCaseSensitive(boolean caseSensitive)

isInverse

public boolean isInverse()
Specifies whether the condition specified with the "condition" property should be treated in the opposite way. For example when condition is FilterCondition.EQUALS and "inverse" property is set to true, the expected filtering behavior is matching the values that are _not_ equal to the filter criterion's argument.

Returns:
true if filter's condition should be treated in the opposite way.

setInverse

public void setInverse(boolean inverse)

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object


Copyright © 1998-2009 TeamDev Ltd. All Rights Reserved.