org.javalid.core.validator
Class BetweenLengthValidatorImpl
java.lang.Object
org.javalid.core.validator.AbstractJavalidValidatorImpl<T>
org.javalid.core.validator.AbstractLengthValidatorImpl<BetweenLength>
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:
- Removed ValidatorSupport instance, using its static methods instead
Changes for 1.2:
- Refactored: Extends AbstractLengthValidatorImpl
- Byte length comparison added
- Support to annotate on StringBuilder
- Since:
- 1.0
- Version:
- 1.2
- Author:
- M.Reuvers
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BetweenLengthValidatorImpl
public BetweenLengthValidatorImpl()
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>