|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Validator
Validate bean instances. Implementations of this interface must be thread-safe.
Method Summary | ||
---|---|---|
BeanDescriptor |
getConstraintsForClass(java.lang.Class<?> clazz)
Return the descriptor object describing bean constraints The returned object (and associated objects including ConstraintDescriptors) are immutable. |
|
|
validate(T object,
java.lang.Class<?>... groups)
Validates all constraints on object. |
|
|
validateProperty(T object,
java.lang.String propertyName,
java.lang.Class<?>... groups)
Validates all constraints placed on the property named <code>propertyName</code> of object |
|
|
validateValue(java.lang.Class<T> beanType,
java.lang.String propertyName,
java.lang.Object value,
java.lang.Class<?>... groups)
Validates all constraints placed on the property named propertyName
would the property value be value
ConstraintViolation objects return null for
ConstraintViolation.getRootBean() and ConstraintViolation.getLeafBean() |
Method Detail |
---|
<T> java.util.Set<ConstraintViolation<T>> validate(T object, java.lang.Class<?>... groups)
object
- object to validategroups
- groups targeted for validation
(default to Default
)
java.lang.IllegalArgumentException
- if object is null
ValidationException
- if a non recoverable error happens
during the validation process<T> java.util.Set<ConstraintViolation<T>> validateProperty(T object, java.lang.String propertyName, java.lang.Class<?>... groups)
object
object
- object to validatepropertyName
- property to validate (ie field and getter constraints)groups
- groups targeted for validation
(default to Default
)
java.lang.IllegalArgumentException
- if object is null, if propertyName null, empty
or not a valid object property
ValidationException
- if a non recoverable error happens
during the validation process<T> java.util.Set<ConstraintViolation<T>> validateValue(java.lang.Class<T> beanType, java.lang.String propertyName, java.lang.Object value, java.lang.Class<?>... groups)
propertyName
would the property value be value
ConstraintViolation
objects return null for
ConstraintViolation.getRootBean()
and ConstraintViolation.getLeafBean()
beanType
- the bean typepropertyName
- property to validatevalue
- property value to validategroups
- groups targeted for validation
(default to Default
)
java.lang.IllegalArgumentException
- if object is null, if propertyName null, empty
or not a valid object property
ValidationException
- if a non recoverable error happens
during the validation processBeanDescriptor getConstraintsForClass(java.lang.Class<?> clazz)
clazz
- class type evaluated
ValidationException
- if a non recoverable error happens
during the metadata discovery or if some
constraints are invalid.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |