public class BeanFieldValidator extends Object implements FieldValidator
| Constructor and Description |
|---|
BeanFieldValidator(Field field,
ValidatorFactory validatorFactory,
BeanValidatorGroupSource beanValidationGroupSource,
ClientConstraintDescriptorSource clientValidatorSource,
FormSupport formSupport,
Environment environment) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
isRequired()
Returns true if any underlying
Validator returns true from Validator.isRequired(). |
void |
render(MarkupWriter writer)
|
void |
validate(Object value)
Invoked after the client-submitted value has been
translated to check that the value conforms
to expectations (often, in terms of minimum or maximum value). |
public BeanFieldValidator(Field field, ValidatorFactory validatorFactory, BeanValidatorGroupSource beanValidationGroupSource, ClientConstraintDescriptorSource clientValidatorSource, FormSupport formSupport, Environment environment)
public boolean isRequired()
FieldValidatorValidator returns true from Validator.isRequired().isRequired in interface FieldValidatorpublic void render(MarkupWriter writer)
FieldValidatorValidator.render(Field, Object, org.apache.tapestry5.ioc.MessageFormatter, MarkupWriter,
org.apache.tapestry5.services.FormSupport). This is called at a point "inside" the tag, so that additional
attributes may be added. In many cases, the underlying Validator may write
client-side JavaScript to enforce the constraint as well.render in interface FieldValidatorwriter - markup writer to direct output to.MarkupWriter.attributes(Object[])public void validate(Object value) throws ValidationException
FieldValidatortranslated to check that the value conforms
to expectations (often, in terms of minimum or maximum value). If and only if the value is approved by all
Validators is the value applied by the field.validate in interface FieldValidatorvalue - the translated value supplied by the userValidationException - if the value violates the constraint5.6.4 - Copyright © 2003-2021 The Apache Software Foundation.