org.javalid.core.validator
Class ValidateListValidatorImpl
java.lang.Object
org.javalid.core.validator.AbstractJavalidValidatorImpl<ValidateList>
org.javalid.core.validator.ValidateListValidatorImpl
- All Implemented Interfaces:
- JavalidValidator<ValidateList>
public class ValidateListValidatorImpl
- extends AbstractJavalidValidatorImpl<ValidateList>
This class is responsible for validating the ValidateList annotation.
Each value in a list is validated separately (like separate validateObject(..) calls)
using the state of the validator that executed this validator (this allows
that recursion etc. is applied correctly to objects from a list).
Changes for 1.1:
- Removed ValidatorSupport instance, using its static methods instead
Changes for 1.2:
- Refactored: Extends AbstractJavalidValidator
- Uses complex validation now, not relying on threadstate anymore
- 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 |
ValidateListValidatorImpl
public ValidateListValidatorImpl()
doValidate
public java.util.List<ValidationMessage> doValidate(ValidateList annotation,
java.lang.Object value,
java.lang.String path,
JvConfigurationWrapper config)
- Specified by:
doValidate in class AbstractJavalidValidatorImpl<ValidateList>
requiresComplexCall
public boolean requiresComplexCall()
- Description copied from interface:
JavalidValidator
- Returns true if this validator requires the current annotation validator to fullfill its
validation (and all extra info).
Normal validators must return false. In that case the default validate(..) method
is called. If false is returned, the validateComplex(..) method is called.
- Specified by:
requiresComplexCall in interface JavalidValidator<ValidateList>- Overrides:
requiresComplexCall in class AbstractJavalidValidatorImpl<ValidateList>
- Returns:
- True if it intends to do complex validation
validateComplex
public java.util.List<ValidationMessage> validateComplex(ValidateList annotation,
java.lang.Object value,
java.lang.String path,
JvConfigurationWrapper config,
ComplexValidationInfo info)
- Description copied from interface:
JavalidValidator
- This the complex variant for validation and is called by the framework
if requiresComplexCall is set to true. The framework delivers an extra
parameter with a lot of extra validation information then.
- Specified by:
validateComplex in interface JavalidValidator<ValidateList>- Overrides:
validateComplex in class AbstractJavalidValidatorImpl<ValidateList>
- Parameters:
annotation - The annotation it is aboutvalue - The value to validatepath - The framework gives the full path for this value you are validating, thus
you can use it directly in the ValidationMessage as path.config - Wrapper containing public configuration info (such as reflectionsupport, beanlookup, can be used if needed)info - Information object about the current validation. Careful with using it! Know what you are doing.
- Returns:
- List with ValidationMessage when validation fails, if no error returns an EMPTY list (not NULL!!!)