|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.tapestry.form.validator.BaseValidator
org.apache.tapestry.form.validator.Required
public class Required
Validator
that ensures a value was supplied.
Constructor Summary | |
---|---|
Required()
|
|
Required(String initializer)
|
Method Summary | |
---|---|
String |
buildMessage(ValidationMessages messages,
IFormComponent field)
|
boolean |
getAcceptsNull()
Returns false. |
boolean |
isRequired()
Returns true, that's what Required means! |
void |
renderContribution(IMarkupWriter writer,
IRequestCycle cycle,
FormComponentContributorContext context,
IFormComponent field)
Does nothing. |
void |
validate(IFormComponent field,
ValidationMessages messages,
Object object)
Invoked to validate input for the field. |
Methods inherited from class org.apache.tapestry.form.validator.BaseValidator |
---|
accumulateProfileProperty, accumulateProperty, getFieldTranslator, getMessage, setMessage |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Required()
public Required(String initializer)
Method Detail |
---|
public boolean getAcceptsNull()
BaseValidator
getAcceptsNull
in interface Validator
getAcceptsNull
in class BaseValidator
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.
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 String buildMessage(ValidationMessages messages, IFormComponent field)
public void renderContribution(IMarkupWriter writer, IRequestCycle cycle, FormComponentContributorContext context, IFormComponent field)
BaseValidator
renderContribution
in interface FormComponentContributor
renderContribution
in class BaseValidator
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 renderedpublic boolean isRequired()
isRequired
in interface Validator
isRequired
in class BaseValidator
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |