com.opensymphony.xwork2.validator.validators
Class LongRangeFieldValidator

java.lang.Object
  extended by com.opensymphony.xwork2.validator.validators.ValidatorSupport
      extended by com.opensymphony.xwork2.validator.validators.FieldValidatorSupport
          extended by com.opensymphony.xwork2.validator.validators.AbstractRangeValidator
              extended by com.opensymphony.xwork2.validator.validators.LongRangeFieldValidator
All Implemented Interfaces:
FieldValidator, ShortCircuitableValidator, Validator

public class LongRangeFieldValidator
extends AbstractRangeValidator

Field Validator that checks if the long specified is within a certain range.

 
              <validators>
           <!-- Plain Validator Syntax -->
           <validator type="long">
               <param name="fieldName">age</param>
               <param name="min">20</param>
               <param name="max">50</param>
               <message>Age needs to be between ${min} and ${max}</message>
           </validator>
           
           <!-- Field Validator Syntax -->
           <field name="age">
               <field-validator type="long">
                   <param name="min">20</param>
                   <param name="max">50</param>
                   <message>Age needs to be between ${min} and ${max}</message>
               </field-validator>
           </field>
      </validators>
 
 

Version:
$Date$

Field Summary
(package private)  Long max
           
(package private)  Long min
           
 
Fields inherited from class com.opensymphony.xwork2.validator.validators.ValidatorSupport
defaultMessage, log, messageKey
 
Constructor Summary
LongRangeFieldValidator()
           
 
Method Summary
 Long getMax()
           
 Comparable getMaxComparatorValue()
           
 Long getMin()
           
 Comparable getMinComparatorValue()
           
 void setMax(Long max)
           
 void setMin(Long min)
           
 
Methods inherited from class com.opensymphony.xwork2.validator.validators.AbstractRangeValidator
validate
 
Methods inherited from class com.opensymphony.xwork2.validator.validators.FieldValidatorSupport
getFieldName, getValidatorType, setFieldName, setValidatorType
 
Methods inherited from class com.opensymphony.xwork2.validator.validators.ValidatorSupport
addActionError, addFieldError, conditionalParse, getDefaultMessage, getFieldValue, getMessage, getMessageKey, getMessageParameters, getParse, getValidatorContext, isShortCircuit, setDefaultMessage, setMessageKey, setMessageParameters, setParse, setShortCircuit, setValidatorContext, setValueStack
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.opensymphony.xwork2.validator.Validator
getDefaultMessage, getMessage, getMessageKey, getMessageParameters, getValidatorContext, setDefaultMessage, setMessageKey, setMessageParameters, setValidatorContext, setValueStack
 

Field Detail

max

Long max

min

Long min
Constructor Detail

LongRangeFieldValidator

public LongRangeFieldValidator()
Method Detail

setMax

public void setMax(Long max)

getMax

public Long getMax()

getMaxComparatorValue

public Comparable getMaxComparatorValue()
Specified by:
getMaxComparatorValue in class AbstractRangeValidator

setMin

public void setMin(Long min)

getMin

public Long getMin()

getMinComparatorValue

public Comparable getMinComparatorValue()
Specified by:
getMinComparatorValue in class AbstractRangeValidator


Copyright © 2000-2009 Apache Software Foundation. All Rights Reserved.