org.javalid.core.validator
Class BetweenLengthValidatorImpl

java.lang.Object
  extended by org.javalid.core.validator.AbstractJavalidValidatorImpl<T>
      extended by org.javalid.core.validator.AbstractLengthValidatorImpl<BetweenLength>
          extended by org.javalid.core.validator.BetweenLengthValidatorImpl
All Implemented Interfaces:
JavalidValidator<BetweenLength>

public class BetweenLengthValidatorImpl
extends AbstractLengthValidatorImpl<BetweenLength>

This class is responsible for validating the BetweenLength annotation. Checks if given value's length is between the minimum and maximum length specified on the annotation. Note the check is inclusive thus: value >= minLength and value <= maxLength.

Can be applied to fields/methods returning: java.lang.String, java.lang.StringBuffer or java.lang.StringBuilder On error adds a ValidationMessage of: MessageCodes.MSG_BETWEEN_LENGTH_ERROR.

ValidationMessage's value property contains {currentValue,minimumLengthValue,maximumLengthValue}

Changes for 1.1:

Changes for 1.2:

Since:
1.0
Version:
1.2
Author:
M.Reuvers

Constructor Summary
BetweenLengthValidatorImpl()
           
 
Method Summary
 java.util.List<ValidationMessage> doValidate(BetweenLength annotation, java.lang.Object value, java.lang.String path, JvConfigurationWrapper config)
           
 
Methods inherited from class org.javalid.core.validator.AbstractLengthValidatorImpl
convertValueToString, determineLength, validateCountAsAndCharset
 
Methods inherited from class org.javalid.core.validator.AbstractJavalidValidatorImpl
checkIsSingleExpression, requiresComplexCall, validate, validateComplex, validationMustBeAppliedToGroup
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BetweenLengthValidatorImpl

public BetweenLengthValidatorImpl()
Method Detail

doValidate

public java.util.List<ValidationMessage> doValidate(BetweenLength annotation,
                                                    java.lang.Object value,
                                                    java.lang.String path,
                                                    JvConfigurationWrapper config)
Specified by:
doValidate in class AbstractJavalidValidatorImpl<BetweenLength>