@RequestScoped @Component public class DefaultBeanValidator extends Object implements BeanValidator
BeanValidator using Bean Validation (JSR303). This implementation
will be enable by vraptor when any implementation of Bean Validation is available into classpath.| Constructor and Description |
|---|
DefaultBeanValidator(Localization localization,
javax.validation.Validator validator,
javax.validation.MessageInterpolator interpolator) |
| Modifier and Type | Method and Description |
|---|---|
List<Message> |
validate(Object bean,
Class<?>... groups)
Validate the bean and return a list of messages if has constraint violations.
|
List<Message> |
validateProperties(Object bean,
String... properties)
Validate the specified bean's properties and return a list of messages if has constraint violations.
|
List<Message> |
validateProperty(Object bean,
String property,
Class<?>... groups)
Validate the specified bean's property and return a list of messages if has constraint violations.
|
public DefaultBeanValidator(Localization localization, javax.validation.Validator validator, javax.validation.MessageInterpolator interpolator)
public List<Message> validate(Object bean, Class<?>... groups)
BeanValidatorvalidate in interface BeanValidatorbean - The object to be validated.groups - The groups that must be validated.public List<Message> validateProperties(Object bean, String... properties)
BeanValidatorvalidateProperties in interface BeanValidatorbean - The object to be validated.properties - The properties that must be validated.public List<Message> validateProperty(Object bean, String property, Class<?>... groups)
BeanValidatorvalidateProperty in interface BeanValidatorbean - The object to be validated.property - The property that must be validated.groups - The groups that must be validated.Copyright © 2014 Caelum. All Rights Reserved.