Interface GwtSpecificValidator<G>
- Type Parameters:
G- the type of bean for this validator
- All Known Implementing Classes:
AbstractGwtSpecificValidator
public interface GwtSpecificValidator<G>
Defines GWT version of
Validator. This used by generate a specific
Validator for a given class G.-
Method Summary
Modifier and TypeMethodDescription<T> voidexpandDefaultAndValidateClassGroups(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> voidexpandDefaultAndValidatePropertyGroups(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> voidexpandDefaultAndValidateValueGroups(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).Getter for bean metadata.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 onobject.<T> voidvalidateClassGroups(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 ofobjectnamedpropertyName.<T> voidvalidatePropertyGroups(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 namedpropertyNameof the classbeanTypewhere the property value isvalue.<T> voidvalidateValueGroups(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).
-
Method Details
-
expandDefaultAndValidateClassGroups
<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).- Type Parameters:
T- the type of the RootBean for this validation context- Parameters:
context- GWT validation context.object- Object being validated.violations- Set of violations to add to.groups- What group(s) to validate.
-
expandDefaultAndValidatePropertyGroups
<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).- Type Parameters:
T- the type of the RootBean for this validation context- Parameters:
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.
-
expandDefaultAndValidateValueGroups
<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).- Type Parameters:
T- the type of the RootBean for this validation context- Parameters:
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.
-
getBeanMetadata
BeanMetadata getBeanMetadata()Getter for bean metadata.- Returns:
- The metadata for the bean class associated with this valdiator.
-
getConstraints
GwtBeanDescriptor<G> getConstraints(ValidationGroupsMetadata validationGroupsMetadata) throws javax.validation.ValidationException Return the descriptor object describing bean constraints. The returned object (and associated objects includingConstraintDescriptors) 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 nulljavax.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 onobject.- Type Parameters:
T- the type of the RootBean for this validation context- Parameters:
context- The gwt validation contextobject- object to validategroups- group or list of groups targeted for validation (default toDefault)- Returns:
- constraint violations or an empty Set if none
- Throws:
IllegalArgumentException- if object is null or if null is passed to the varargs groupsjavax.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.- Type Parameters:
T- the type of the RootBean for this validation context- 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 ofobjectnamedpropertyName.- Type Parameters:
T- the type of the RootBean for this validation context- Parameters:
context- The gwt validation contextobject- object to validatepropertyName- property to validate (ie field and getter constraints)groups- group or list of groups targeted for validation (default toDefault)- Returns:
- constraint violations or an empty Set if none
- Throws:
IllegalArgumentException- ifobjectis null, ifpropertyNamenull, empty or not a valid object property or if null is passed to the varargs groupsjavax.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).- Type Parameters:
T- the type of the RootBean for this validation context- 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 namedpropertyNameof the classbeanTypewhere the property value isvalue.ConstraintViolationobjects return null forConstraintViolation.getRootBean()andConstraintViolation.getLeafBean()- Type Parameters:
T- the type of the RootBean for this validation context- Parameters:
context- The gwt validation contextbeanType- the bean typepropertyName- property to validatevalue- property value to validategroups- group or list of groups targeted for validation (default toDefault)- Returns:
- constraint violations or an empty Set if none
- Throws:
IllegalArgumentException- ifbeanTypeis null, ifpropertyNamenull, empty or not a valid object property or if null is passed to the varargs groupsjavax.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).- Type Parameters:
T- the type of the RootBean for this validation context- 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.
-