public interface Constraint
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getName() |
java.lang.Object |
getParameter() |
java.lang.String |
getPropertyName() |
boolean |
isValid()
Return whether the constraint is valid for the owning class
|
void |
setMessageSource(MessageSource source)
The message source to evaluate the default messages from
|
void |
setOwningClass(java.lang.Class owningClass)
The class the constraint applies to
|
void |
setParameter(java.lang.Object parameter)
The parameter which the constraint is validated against.
|
void |
setPropertyName(java.lang.String propertyName)
The name of the property the constraint applies to
|
boolean |
supports(java.lang.Class type)
Returns whether the constraint supports being applied against the specified type;
|
void |
validate(java.lang.Object target,
java.lang.Object propertyValue,
Errors errors)
Validate this constraint against a property value.
|
boolean supports(java.lang.Class type)
type
- The type to supportboolean isValid()
void validate(java.lang.Object target, java.lang.Object propertyValue, Errors errors)
target
- propertyValue
- The property value to validateerrors
- The errors instance to record errors againstvoid setParameter(java.lang.Object parameter)
parameter
- java.lang.Object getParameter()
void setOwningClass(java.lang.Class owningClass)
owningClass
- void setPropertyName(java.lang.String propertyName)
propertyName
- java.lang.String getName()
java.lang.String getPropertyName()
void setMessageSource(MessageSource source)
source
-