Class BeanFieldValidator
java.lang.Object
org.apache.tapestry5.internal.beanvalidator.BeanFieldValidator
- All Implemented Interfaces:
FieldValidator
-
Constructor Summary
ConstructorsConstructorDescriptionBeanFieldValidator(Field field, javax.validation.ValidatorFactory validatorFactory, BeanValidatorGroupSource beanValidationGroupSource, ClientConstraintDescriptorSource clientValidatorSource, FormSupport formSupport, Environment environment) -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns true if any underlyingValidatorreturns true fromValidator.isRequired().voidrender(MarkupWriter writer) voidInvoked after the client-submitted value has beentranslatedto check that the value conforms to expectations (often, in terms of minimum or maximum value).
-
Constructor Details
-
BeanFieldValidator
public BeanFieldValidator(Field field, javax.validation.ValidatorFactory validatorFactory, BeanValidatorGroupSource beanValidationGroupSource, ClientConstraintDescriptorSource clientValidatorSource, FormSupport formSupport, Environment environment)
-
-
Method Details
-
isRequired
Description copied from interface:FieldValidatorReturns true if any underlyingValidatorreturns true fromValidator.isRequired().- Specified by:
isRequiredin interfaceFieldValidator- Returns:
- true if the field is required (a non-blank value is expected)
-
render
Description copied from interface:FieldValidatorInvokesValidator.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 underlyingValidatormay write client-side JavaScript to enforce the constraint as well.- Specified by:
renderin interfaceFieldValidator- Parameters:
writer- markup writer to direct output to.- See Also:
-
validate
Description copied from interface:FieldValidatorInvoked after the client-submitted value has beentranslatedto 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.- Specified by:
validatein interfaceFieldValidator- Parameters:
value- the translated value supplied by the user- Throws:
ValidationException- if the value violates the constraint
-