org.apache.myfaces.commons.validator
Class CompareToValidator

java.lang.Object
  extended by org.apache.myfaces.commons.validator.ValidatorBase
      extended by org.apache.myfaces.commons.validator.AbstractCompareToValidator
          extended by org.apache.myfaces.commons.validator.CompareToValidator
All Implemented Interfaces:
java.util.EventListener, javax.faces.component.StateHolder, javax.faces.validator.Validator

public class CompareToValidator
extends AbstractCompareToValidator


Field Summary
static java.lang.String VALIDATOR_ID
           
 
Fields inherited from class org.apache.myfaces.commons.validator.AbstractCompareToValidator
COMPARE_TO_MESSAGE_ID, OPERATOR_EQUALS, OPERATOR_EQUALS_ALT, OPERATOR_EQUALS_ALT2, OPERATOR_GREATER_THAN, OPERATOR_GREATER_THAN_ALT, OPERATOR_GREATER_THAN_OR_EQUALS, OPERATOR_GREATER_THAN_OR_EQUALS_ALT, OPERATOR_LESS_THAN, OPERATOR_LESS_THAN_ALT, OPERATOR_LESS_THAN_OR_EQUALS, OPERATOR_LESS_THAN_OR_EQUALS_ALT, OPERATOR_NOT_EQUALS, OPERATOR_NOT_EQUALS_ALT
 
Fields inherited from interface javax.faces.validator.Validator
NOT_IN_RANGE_MESSAGE_ID
 
Constructor Summary
CompareToValidator()
           
 
Method Summary
 java.lang.String getAlternateOperatorName()
          custom operator name in error message (ie "after" instead of "greater than" for dates)
 java.lang.Object getComparator()
          Value binding for an alternate java.util.Comparator object if component values don't implement Comparable
 java.lang.String getFor()
          The JSF id of the component with which to compare values.
 java.lang.String getOperator()
          Operator for comparison: equals: eq, ==, =, not equals: ne, !=, greater than: gt, >, less than: lt, <, greater than or equals: ge, >=, less than or equals: le, <=
 void restoreState(javax.faces.context.FacesContext facesContext, java.lang.Object state)
           
 java.lang.Object saveState(javax.faces.context.FacesContext facesContext)
           
 void setAlternateOperatorName(java.lang.String alternateOperatorName)
           
 void setComparator(java.lang.Object comparator)
           
 void setFor(java.lang.String forParam)
           
 void setOperator(java.lang.String operator)
           
 
Methods inherited from class org.apache.myfaces.commons.validator.AbstractCompareToValidator
createComparator, getClassCastExceptionMessage, getOperatorForString, nameForOperator, validate, validateOperatorOnComparisonResult
 
Methods inherited from class org.apache.myfaces.commons.validator.ValidatorBase
getDetailMessage, getFacesContext, getFacesMessage, getMessage, getStringValue, getSummaryMessage, getValueExpression, isTransient, restoreAttachedState, saveAttachedState, setDetailMessage, setMessage, setSummaryMessage, setTransient, setValueExpression
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VALIDATOR_ID

public static final java.lang.String VALIDATOR_ID
See Also:
Constant Field Values
Constructor Detail

CompareToValidator

public CompareToValidator()
Method Detail

getFor

public java.lang.String getFor()
Description copied from class: AbstractCompareToValidator
The JSF id of the component with which to compare values.

Specified by:
getFor in class AbstractCompareToValidator
Returns:
the foreign component_id, on which a value should be validated

setFor

public void setFor(java.lang.String forParam)
Specified by:
setFor in class AbstractCompareToValidator
Parameters:
forParam - the foreign component_id, on which a value should be validated

getOperator

public java.lang.String getOperator()
Description copied from class: AbstractCompareToValidator
Operator for comparison: equals: eq, ==, =, not equals: ne, !=, greater than: gt, >, less than: lt, <, greater than or equals: ge, >=, less than or equals: le, <=

Specified by:
getOperator in class AbstractCompareToValidator
Returns:

setOperator

public void setOperator(java.lang.String operator)
Specified by:
setOperator in class AbstractCompareToValidator

getComparator

public java.lang.Object getComparator()
Description copied from class: AbstractCompareToValidator
Value binding for an alternate java.util.Comparator object if component values don't implement Comparable

Specified by:
getComparator in class AbstractCompareToValidator
Returns:

setComparator

public void setComparator(java.lang.Object comparator)
Specified by:
setComparator in class AbstractCompareToValidator

getAlternateOperatorName

public java.lang.String getAlternateOperatorName()
Description copied from class: AbstractCompareToValidator
custom operator name in error message (ie "after" instead of "greater than" for dates)

Specified by:
getAlternateOperatorName in class AbstractCompareToValidator
Returns:

setAlternateOperatorName

public void setAlternateOperatorName(java.lang.String alternateOperatorName)
Specified by:
setAlternateOperatorName in class AbstractCompareToValidator

saveState

public java.lang.Object saveState(javax.faces.context.FacesContext facesContext)
Specified by:
saveState in interface javax.faces.component.StateHolder
Overrides:
saveState in class ValidatorBase

restoreState

public void restoreState(javax.faces.context.FacesContext facesContext,
                         java.lang.Object state)
Specified by:
restoreState in interface javax.faces.component.StateHolder
Overrides:
restoreState in class ValidatorBase


Copyright © 2007-2010 The Apache Software Foundation. All Rights Reserved.