G
- the type of bean for this validatorpublic interface GwtSpecificValidator<G>
Validator
. This used by
generate a specific Validator for a given class G.Modifier and Type | Method and Description |
---|---|
<T> void |
expandDefaultAndValidateClassGroups(GwtValidationContext<T> context,
G object,
Set<javax.validation.ConstraintViolation<T>> violations,
Group... groups)
Helper method used to first expand the Default group sequence and then
perform validation of a bean using the specific group(s).
|
<T> void |
expandDefaultAndValidatePropertyGroups(GwtValidationContext<T> context,
G object,
String propertyName,
Set<javax.validation.ConstraintViolation<T>> violations,
Group... groups)
Helper method used to first expand the Default group sequence and then
perform validation of a bean using the specific group(s).
|
<T> void |
expandDefaultAndValidateValueGroups(GwtValidationContext<T> context,
Class<G> beanType,
String propertyName,
Object value,
Set<javax.validation.ConstraintViolation<T>> violations,
Group... groups)
Helper method used to first expand the Default group sequence and then
perform validation of a bean using the specific group(s).
|
BeanMetadata |
getBeanMetadata() |
GwtBeanDescriptor<G> |
getConstraints(ValidationGroupsMetadata validationGroupsMetadata)
Return the descriptor object describing bean constraints.
|
<T> Set<javax.validation.ConstraintViolation<T>> |
validate(GwtValidationContext<T> context,
G object,
Class<?>... groups)
Validates all constraints on
object . |
<T> void |
validateClassGroups(GwtValidationContext<T> context,
G object,
Set<javax.validation.ConstraintViolation<T>> violations,
Class<?>... groups)
Helper method used to perform validation of a bean using specific group(s).
|
<T> Set<javax.validation.ConstraintViolation<T>> |
validateProperty(GwtValidationContext<T> context,
G object,
String propertyName,
Class<?>... groups)
Validates all constraints placed on the property of
object
named propertyName . |
<T> void |
validatePropertyGroups(GwtValidationContext<T> context,
G object,
String propertyName,
Set<javax.validation.ConstraintViolation<T>> violations,
Class<?>... groups)
Helper method used to perform validation of a bean property using specific group(s).
|
<T> Set<javax.validation.ConstraintViolation<T>> |
validateValue(GwtValidationContext<T> context,
Class<G> beanType,
String propertyName,
Object value,
Class<?>... groups)
Validates all constraints placed on the property named
propertyName of the class beanType where the
property value is value . |
<T> void |
validateValueGroups(GwtValidationContext<T> context,
Class<G> beanType,
String propertyName,
Object value,
Set<javax.validation.ConstraintViolation<T>> violations,
Class<?>... groups)
Helper method used to perform validation of a class property with a specified value
using specific group(s).
|
<T> void expandDefaultAndValidateClassGroups(GwtValidationContext<T> context, G object, Set<javax.validation.ConstraintViolation<T>> violations, Group... groups)
context
- GWT validation context.object
- Object being validated.violations
- Set of violations to add to.groups
- What group(s) to validate.<T> void expandDefaultAndValidatePropertyGroups(GwtValidationContext<T> context, G object, String propertyName, Set<javax.validation.ConstraintViolation<T>> violations, Group... groups)
context
- GWT validation context.object
- Object being validated.propertyName
- The name of the property being validated.violations
- Set of violations to add to.groups
- What group(s) to validate.<T> void expandDefaultAndValidateValueGroups(GwtValidationContext<T> context, Class<G> beanType, String propertyName, Object value, Set<javax.validation.ConstraintViolation<T>> violations, Group... groups)
context
- GWT validation context.beanType
- Class being validated.propertyName
- The name of the property being validated.value
- The value of the property to use.violations
- Set of violations to add to.groups
- What group(s) to validate.BeanMetadata getBeanMetadata()
GwtBeanDescriptor<G> getConstraints(ValidationGroupsMetadata validationGroupsMetadata) throws javax.validation.ValidationException
ConstraintDescriptors) are immutable.
- Parameters:
validationGroupsMetadata
- The validation groups metadata for the validator.
- Returns:
- the bean descriptor for the class associated with this validator.
- Throws:
IllegalArgumentException
- if clazz is null
javax.validation.ValidationException
- if a non recoverable error happens during the
metadata discovery or if some constraints are invalid.
-
validate
<T> Set<javax.validation.ConstraintViolation<T>> validate(GwtValidationContext<T> context,
G object,
Class<?>... groups)
throws javax.validation.ValidationException
Validates all constraints on object
.
- Parameters:
context
- The gwt validation context
object
- object to validate
groups
- group or list of groups targeted for validation (default to
Default
)
- Returns:
- constraint violations or an empty Set if none
- Throws:
IllegalArgumentException
- if object is null or if null is passed to
the varargs groups
javax.validation.ValidationException
- if a non recoverable error happens during the
validation process
-
validateClassGroups
<T> void validateClassGroups(GwtValidationContext<T> context,
G object,
Set<javax.validation.ConstraintViolation<T>> violations,
Class<?>... groups)
Helper method used to perform validation of a bean using specific group(s). Does not expand
the Default group seqeunce if it is redefined.
- Parameters:
context
- GWT validation context.
object
- Object being validated.
violations
- Set of violations to add to.
groups
- What group(s) to validate.
-
validateProperty
<T> Set<javax.validation.ConstraintViolation<T>> validateProperty(GwtValidationContext<T> context,
G object,
String propertyName,
Class<?>... groups)
throws javax.validation.ValidationException
Validates all constraints placed on the property of object
named propertyName
.
- Parameters:
context
- The gwt validation context
object
- object to validate
propertyName
- property to validate (ie field and getter constraints)
groups
- group or list of groups targeted for validation (default to
Default
)
- Returns:
- constraint violations or an empty Set if none
- Throws:
IllegalArgumentException
- if object
is null, if
propertyName
null, empty or not a valid object
property or if null is passed to the varargs groups
javax.validation.ValidationException
- if a non recoverable error happens during the
validation process
-
validatePropertyGroups
<T> void validatePropertyGroups(GwtValidationContext<T> context,
G object,
String propertyName,
Set<javax.validation.ConstraintViolation<T>> violations,
Class<?>... groups)
Helper method used to perform validation of a bean property using specific group(s).
- Parameters:
context
- GWT validation context.
object
- Object with property being validated.
propertyName
- Name of property to validate.
violations
- Set of violations to add to.
groups
- What group(s) to validate.
-
validateValue
<T> Set<javax.validation.ConstraintViolation<T>> validateValue(GwtValidationContext<T> context,
Class<G> beanType,
String propertyName,
Object value,
Class<?>... groups)
throws javax.validation.ValidationException
Validates all constraints placed on the property named
propertyName
of the class beanType
where the
property value is value
.
ConstraintViolation
objects return null for
ConstraintViolation.getRootBean()
and
ConstraintViolation.getLeafBean()
- Parameters:
context
- The gwt validation context
beanType
- the bean type
propertyName
- property to validate
value
- property value to validate
groups
- group or list of groups targeted for validation (default to
Default
)
- Returns:
- constraint violations or an empty Set if none
- Throws:
IllegalArgumentException
- if beanType
is null, if
propertyName
null, empty or not a valid object
property or if null is passed to the varargs groups
javax.validation.ValidationException
- if a non recoverable error happens during the
validation process
-
validateValueGroups
<T> void validateValueGroups(GwtValidationContext<T> context,
Class<G> beanType,
String propertyName,
Object value,
Set<javax.validation.ConstraintViolation<T>> violations,
Class<?>... groups)
Helper method used to perform validation of a class property with a specified value
using specific group(s).
- Parameters:
context
- GWT validation context.
beanType
- Class with property being validated.
propertyName
- Name of property to validate.
value
- The value of the property to use.
violations
- Set of violations to add to.
groups
- What group(s) to validate.
Copyright © 2018. All rights reserved.