public class BeanValidator extends java.lang.Object implements Field.Validator
Field
instance using BeanValidation
. DatasourceComponent.setDatasource(Datasource, String)
call if property enclosing class
has BeanValidation
constraints.Modifier and Type | Class and Description |
---|---|
static class |
BeanValidator.BeanValidationViolationCause |
Constructor and Description |
---|
BeanValidator(java.lang.Class beanClass,
java.lang.String beanProperty) |
BeanValidator(java.lang.Class beanClass,
java.lang.String beanProperty,
java.lang.Class[] validationGroups) |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getDefaultErrorMessage() |
java.lang.String |
getValidationErrorMessage() |
java.lang.Class[] |
getValidationGroups() |
void |
setValidationErrorMessage(java.lang.String validationErrorMessage)
Set main validation error message.
|
void |
setValidationGroups(java.lang.Class[] validationGroups)
Set custom validation groups.
|
void |
validate(java.lang.Object value) |
public BeanValidator(java.lang.Class beanClass, java.lang.String beanProperty)
public BeanValidator(java.lang.Class beanClass, java.lang.String beanProperty, java.lang.Class[] validationGroups)
public java.lang.Class[] getValidationGroups()
public void setValidationGroups(java.lang.Class[] validationGroups)
Default
and UiComponentChecks
groups.validationGroups
- validation groupspublic java.lang.String getValidationErrorMessage()
public void setValidationErrorMessage(java.lang.String validationErrorMessage)
validationErrorMessage
- validation error messagepublic void validate(java.lang.Object value) throws ValidationException
validate
in interface Field.Validator
value
- field value to validateValidationException
- this exception must be thrown by the validator if the value is not validpublic java.lang.String getDefaultErrorMessage()