public class ValidatorConstraint extends AbstractConstraint
A constraint class that validates using a user-supplied closure.
The Closure will receive one or two parameters containing the new value of the property and the object on which the validation is being performed. The value is always the first parameterm and the object is the second. These parameters must be type compatible with the value of the property and constrained class.
The Closure can return any of:
classShortName, constraintOwningClass, constraintParameter, constraintPropertyName, messageSource| Constructor and Description |
|---|
ValidatorConstraint() |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getName() |
protected void |
processValidate(java.lang.Object target,
java.lang.Object propertyValue,
org.springframework.validation.Errors errors) |
void |
setParameter(java.lang.Object constraintParameter)
The parameter which the constraint is validated against.
|
protected boolean |
skipBlankValues() |
protected boolean |
skipNullValues() |
boolean |
supports(java.lang.Class type)
Returns whether the constraint supports being applied against the specified type;
|
checkState, getDefaultMessage, getParameter, getPropertyName, isValid, rejectValue, rejectValue, rejectValue, rejectValue, rejectValue, rejectValueWithDefaultMessage, setMessageSource, setOwningClass, setPropertyName, toString, validateprotected boolean skipNullValues()
skipNullValues in class AbstractConstraintprotected boolean skipBlankValues()
skipBlankValues in class AbstractConstraintprotected void processValidate(java.lang.Object target,
java.lang.Object propertyValue,
org.springframework.validation.Errors errors)
processValidate in class AbstractConstraintpublic void setParameter(java.lang.Object constraintParameter)
ConstraintsetParameter in interface ConstraintsetParameter in class AbstractConstraintconstraintParameter - The constraintParameter to set.public java.lang.String getName()
public boolean supports(java.lang.Class type)
Constrainttype - The type to support