org.javalid.core.validator
Class MaxLengthValidatorImpl

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

public class MaxLengthValidatorImpl
extends AbstractLengthValidatorImpl<MaxLength>

This class is responsible for validating the MaxLength annotation. Checks if given value is <= than the length specified on the annotation. Can be applied to methods returning: java.lang.String, java.lang.StringBuffer or java.lang.StringBuilder. On error adds a ValidationMessage of: MessageCodes.MSG_MAX_LENGTH_ERROR.

ValidationMessage's value property contains currentValue,annotationValue.

Changes for 1.1:

Changes for 1.2:

Since:
1.0
Version:
1.2
Author:
M.Reuvers

Constructor Summary
MaxLengthValidatorImpl()
           
 
Method Summary
 java.util.List<ValidationMessage> doValidate(MaxLength 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

MaxLengthValidatorImpl

public MaxLengthValidatorImpl()
Method Detail

doValidate

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