Class FieldValidatorImpl
java.lang.Object
org.apache.tapestry5.internal.services.FieldValidatorImpl
- All Implemented Interfaces:
FieldValidator
-
Constructor Summary
ConstructorsConstructorDescriptionFieldValidatorImpl
(Field field, Object constraintValue, MessageFormatter messageFormatter, Validator validator, FormSupport formSupport) -
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns true if any underlyingValidator
returns true fromValidator.isRequired()
.void
render
(MarkupWriter writer) void
Invoked after the client-submitted value has beentranslated
to check that the value conforms to expectations (often, in terms of minimum or maximum value).
-
Constructor Details
-
FieldValidatorImpl
public FieldValidatorImpl(Field field, Object constraintValue, MessageFormatter messageFormatter, Validator validator, FormSupport formSupport)
-
-
Method Details
-
validate
Description copied from interface:FieldValidator
Invoked after the client-submitted value has beentranslated
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.- Specified by:
validate
in interfaceFieldValidator
- Parameters:
value
- the translated value supplied by the user- Throws:
ValidationException
- if the value violates the constraint
-
render
Description copied from interface:FieldValidator
InvokesValidator.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 underlyingValidator
may write client-side JavaScript to enforce the constraint as well.- Specified by:
render
in interfaceFieldValidator
- Parameters:
writer
- markup writer to direct output to.- See Also:
-
isRequired
Description copied from interface:FieldValidator
Returns true if any underlyingValidator
returns true fromValidator.isRequired()
.- Specified by:
isRequired
in interfaceFieldValidator
- Returns:
- true if the field is required (a non-blank value is expected)
-