org.jaffa.components.finder
Class StringCriteriaField

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

public class StringCriteriaField
extends Object
implements CriteriaField

This class will be used by the Finder components to hold a String 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
StringCriteriaField()
          Default constructor.
StringCriteriaField(String operator, String value)
          Adds a Criteria.
StringCriteriaField(String operator, String[] values)
          Adds a Criteria.
 
Method Summary
 String getOperator()
          Getter for property operator.
static StringCriteriaField getStringCriteriaField(String operator, String value, StringFieldMetaData meta)
          This will generate a CriteriaField object based on the input parameters.
 String[] getValues()
          Getter for property values.
 Object[] returnValuesAsObjectArray()
          Getter for property values.
 void setOperator(String operator)
          Setter for the property operator.
 void setValues(String[] 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

StringCriteriaField

public StringCriteriaField(String operator,
                           String 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'.

StringCriteriaField

public StringCriteriaField(String operator,
                           String[] 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'.

StringCriteriaField

public StringCriteriaField()
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 String[] getValues()
Getter for property values.

Returns:
An array of values for the Criteria.

toString

public String toString()
Returns diagnostic information.

Returns:
diagnostic information.

getStringCriteriaField

public static StringCriteriaField getStringCriteriaField(String operator,
                                                         String value,
                                                         StringFieldMetaData 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(String[] 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.