|
||||||||||
| 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. |
|
|
unwrap(java.lang.Class<T> type)
Return an object of the specified type to allow access to the provider-specific API. |
|
|
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 propertyName
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
or if null is passed to the varargs groups
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)
propertyName
of 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
or if null is passed to the varargs groups
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 beanType is null, if propertyName null, empty
or not a valid object property
or if null is passed to the varargs groups
ValidationException - if a non recoverable error happens
during the validation processBeanDescriptor getConstraintsForClass(java.lang.Class<?> clazz)
clazz - class type evaluated
java.lang.IllegalArgumentException - if clazz is null
ValidationException - if a non recoverable error happens
during the metadata discovery or if some
constraints are invalid.<T> T unwrap(java.lang.Class<T> type)
type - the class of the object to be returned.
ValidationException - if the provider does not
support the call.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||