org.springmodules.validation.bean.rule
Class SizeValidationRule

java.lang.Object
  extended by org.springmodules.validation.bean.rule.AbstractValidationRule
      extended by org.springmodules.validation.bean.rule.SizeValidationRule
All Implemented Interfaces:
ValidationRule

public class SizeValidationRule
extends AbstractValidationRule

An implementation of AbstractValidationRule that validates that a collection/array size is within specific bounds.

Author:
Uri Boness

Field Summary
static String DEFAULT_ERROR_CODE
           
 
Constructor Summary
SizeValidationRule(int min, int max)
          Constructs a new SizeValidationRule with given lower bound (min) and upper bound (max) for the size of the validated collection/array.
 
Method Summary
 Condition getCondition()
          Returns the condition of this validation rule.
 int getMax()
           
 int getMin()
           
 
Methods inherited from class org.springmodules.validation.bean.rule.AbstractValidationRule
checkContexts, createErrorArgumentsResolver, createErrorArgumentsResolver, createErrorArgumentsResolver, createErrorArgumentsResolver, getDefaultErrorMessage, getErrorArguments, getErrorCode, isApplicable, setApplicabilityCondition, setContextTokens, setDefaultErrorMessage, setErrorArgumentsResolver, setErrorCode, supportsNullValues
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_ERROR_CODE

public static final String DEFAULT_ERROR_CODE
See Also:
Constant Field Values
Constructor Detail

SizeValidationRule

public SizeValidationRule(int min,
                          int max)
Constructs a new SizeValidationRule with given lower bound (min) and upper bound (max) for the size of the validated collection/array.

Parameters:
min - The lower bound of the size.
max - The upper bound of the size.
Method Detail

getCondition

public Condition getCondition()
Returns the condition of this validation rule.

Returns:
The condition of this validation rule.
See Also:
ValidationRule.getCondition()

getMin

public int getMin()

getMax

public int getMax()


Copyright © 2009. All Rights Reserved.