|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.tapestry.form.validator.AbstractValidatorWrapper
public abstract class AbstractValidatorWrapper
Abstract implementation of Validator
that delegates to
some other object.
Constructor Summary | |
---|---|
AbstractValidatorWrapper()
|
Method Summary | |
---|---|
boolean |
getAcceptsNull()
Returns true if this validator accepts null as the object parameter to validate(). |
protected abstract Validator |
getDelegate()
|
boolean |
isRequired()
Returns true if this field is required. |
void |
renderContribution(IMarkupWriter writer,
IRequestCycle cycle,
FormComponentContributorContext context,
IFormComponent field)
Invoked by a form component after it finishes rendering its tag (but before the tag is closed) to allow this object to contribute to the component's rendering process. |
void |
validate(IFormComponent field,
ValidationMessages messages,
Object object)
Invoked to validate input for the field. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AbstractValidatorWrapper()
Method Detail |
---|
protected abstract Validator getDelegate()
public void validate(IFormComponent field, ValidationMessages messages, Object object) throws ValidatorException
Validator
Translator
will have already converted the
submitted user input string into an object.
validate
in interface Validator
field
- the form element component being validated, often used to determine the
user presentable name
for the field, used
in error messages.messages
- access to the pre-defined validation messages, in the appropriate localeobject
- the client-side representation of the field's data. May be null if the client did
not provide a value for the field (most Validators should check for null and
perform no check if null).
ValidatorException
- if the object violates the constraint represented by this Validator.public boolean getAcceptsNull()
Validator
getAcceptsNull
in interface Validator
public boolean isRequired()
Validator
isRequired
in interface Validator
public void renderContribution(IMarkupWriter writer, IRequestCycle cycle, FormComponentContributorContext context, IFormComponent field)
FormComponentContributor
renderContribution
in interface FormComponentContributor
writer
- allows contributor to write additional attributes into the component's tagcycle
- for accessing request informationcontext
- utilities for genering messages and client-side validationfield
- the field for which contributions are being rendered
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |