org.jaffa.components.finder
Class BooleanCriteriaField

java.lang.Object
  extended byorg.jaffa.components.finder.BooleanCriteriaField
All Implemented Interfaces:
CriteriaField

public class BooleanCriteriaField
extends Object
implements CriteriaField

This class will be used by the Finder components to hold a Boolean criteria.


Field Summary
 
Fields inherited from interface org.jaffa.components.finder.CriteriaField
CONSECUTIVE_SEPARATORS, CONSECUTIVE_SEPARATORS_WITH_SPACE, RELATIONAL_BEGINS_WITH, RELATIONAL_BETWEEN, RELATIONAL_ENDS_WITH, RELATIONAL_EQUALS, RELATIONAL_GREATER_THAN, RELATIONAL_GREATER_THAN_EQUAL_TO, RELATIONAL_IN, RELATIONAL_IS_NOT_NULL, RELATIONAL_IS_NULL, RELATIONAL_LIKE, RELATIONAL_NOT_EQUALS, RELATIONAL_SMALLER_THAN, RELATIONAL_SMALLER_THAN_EQUAL_TO, SEPARATOR_CHAR_FOR_IN_BETWEEN_OPERATORS, SEPARATOR_FOR_IN_BETWEEN_OPERATORS
 
Constructor Summary
BooleanCriteriaField()
          Default constructor.
BooleanCriteriaField(String operator, Boolean value)
          Adds a Criteria.
BooleanCriteriaField(String operator, Boolean[] values)
          Adds a Criteria.
 
Method Summary
static BooleanCriteriaField getBooleanCriteriaField(String operator, String value, BooleanFieldMetaData meta)
          This will generate a CriteriaField object based on the input parameters.
 String getOperator()
          Getter for property operator.
 Boolean[] getValues()
          Getter for property values.
 Object[] returnValuesAsObjectArray()
          Getter for property values.
 void setOperator(String operator)
          Setter for the property operator.
 void setValues(Boolean[] values)
          Setter for the property values.
 String toString()
          Returns diagnostic information.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BooleanCriteriaField

public BooleanCriteriaField(String operator,
                            Boolean value)
                     throws IllegalArgumentException
Adds a Criteria.

Parameters:
operator - the operator of the criteria.
value - the value of the criteria.
Throws:
IllegalArgumentException - if the operator is null. The exception will also be thrown if the value is null and the operator is neither 'IsNull' nor 'IsNotNull'.

BooleanCriteriaField

public BooleanCriteriaField(String operator,
                            Boolean[] values)
                     throws IllegalArgumentException
Adds a Criteria.

Parameters:
operator - the operator of the criteria.
values - the value array of the criteria.
Throws:
IllegalArgumentException - if the operator is null. The exception will also be thrown if the value is null and the operator is neither 'IsNull' nor 'IsNotNull'.

BooleanCriteriaField

public BooleanCriteriaField()
Default constructor. NOTE: This was added to support tools, which create instances of this class by bean introspection. In all other cases, it is recommended to use the static methods to instantiate this class.

Method Detail

getOperator

public String getOperator()
Getter for property operator.

Specified by:
getOperator in interface CriteriaField
Returns:
Value of property operator.

returnValuesAsObjectArray

public Object[] returnValuesAsObjectArray()
Getter for property values. This basically invokes the getValues() method.

Specified by:
returnValuesAsObjectArray in interface CriteriaField
Returns:
An array of values for the Criteria.

getValues

public Boolean[] getValues()
Getter for property values.

Returns:
An array of values for the Criteria.

toString

public String toString()
Returns diagnostic information.

Returns:
diagnostic information.

getBooleanCriteriaField

public static BooleanCriteriaField getBooleanCriteriaField(String operator,
                                                           String value,
                                                           BooleanFieldMetaData meta)
This will generate a CriteriaField object based on the input parameters.

Parameters:
operator - The operator of the criteria.
value - The value for the criteria. Multiple values should be separated by comma.
meta - The FieldMetaData object to obtain the layout for parsing.
Returns:
a CriteriaField object based on the input parameters.

setOperator

public void setOperator(String operator)
Setter for the property operator. NOTE: This was added to support tools, which create instances of this class by bean introspection. In all other cases, it is recommended to use the static methods to instantiate this class.

Parameters:
operator - The value of the property operator.

setValues

public void setValues(Boolean[] values)
Setter for the property values. NOTE: This was added to support tools, which create instances of this class by bean introspection. In all other cases, it is recommended to use the static methods to instantiate this class.

Parameters:
values - The value of the property values.


Copyright © 2002-2004 JAFFA Project.