|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.vaadin.data.validator.BeanValidator
public class BeanValidator
Vaadin Validator using the JSR-303 (javax.validation)
annotation-based bean validation.
The annotations of the fields of the beans are used to determine the
validation to perform.
Note that a JSR-303 implementation (e.g. Hibernate Validator or Apache Bean
Validation - formerly agimatec validation) must be present on the project
classpath when using bean validation.
| Nested Class Summary | |
|---|---|
protected static class |
BeanValidator.SimpleContext
Simple implementation of a message interpolator context that returns fixed values. |
| Nested classes/interfaces inherited from interface com.vaadin.data.Validator |
|---|
Validator.EmptyValueException, Validator.InvalidValueException |
| Constructor Summary | |
|---|---|
BeanValidator(java.lang.Class<?> beanClass,
java.lang.String propertyName)
Creates a Vaadin Validator utilizing JSR-303 bean validation. |
|
| Method Summary | |
|---|---|
protected javax.validation.Validator |
getJavaxBeanValidator()
Returns a shared Validator instance to use. |
protected static javax.validation.ValidatorFactory |
getJavaxBeanValidatorFactory()
Returns the underlying JSR-303 bean validator factory used. |
java.util.Locale |
getLocale()
Gets the locale used for validation error messages. |
void |
setLocale(java.util.Locale locale)
Sets the locale used for validation error messages. |
void |
validate(java.lang.Object value)
Checks the given value against this validator. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public BeanValidator(java.lang.Class<?> beanClass,
java.lang.String propertyName)
Validator utilizing JSR-303 bean validation.
beanClass - bean class based on which the validation should be performedpropertyName - property to validate| Method Detail |
|---|
public void validate(java.lang.Object value)
throws Validator.InvalidValueException
ValidatorValidator.InvalidValueException is thrown.
validate in interface Validatorvalue - the value to check
Validator.InvalidValueException - if the value is invalidpublic void setLocale(java.util.Locale locale)
locale - public java.util.Locale getLocale()
protected static javax.validation.ValidatorFactory getJavaxBeanValidatorFactory()
Validation if necessary.
ValidatorFactory to useprotected javax.validation.Validator getJavaxBeanValidator()
BeanValidator instance.
Validator to use
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||