|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IValidator
An object that works with an IFormComponent
to format output (convert object values to
strings values) and to process input (convert strings to object values and validate them).
Note that this interface represents validation as supported in Tapestry 2.x to 3.0. It has been
outdated (and will eventually be deprecated) by new support in Tapestry 4.0, centered around the
Translator
and
Validator
interfaces.
Method Summary | |
---|---|
boolean |
isRequired()
All validators must implement a required property. |
void |
renderValidatorContribution(IFormComponent field,
IMarkupWriter writer,
IRequestCycle cycle)
Invoked by the field after it finishes rendering its tag (but before the tag is closed) to allow the validator to provide a contribution to the rendering process. |
void |
setScriptSource(IScriptSource scriptSource)
Sets the script source used to resolve script paths. |
Object |
toObject(IFormComponent field,
String input)
Converts input, submitted by the client, into an object value. |
String |
toString(IFormComponent field,
Object value)
Invoked during rendering to convert an object value (which may be null) to a String. |
Method Detail |
---|
boolean isRequired()
String toString(IFormComponent field, Object value)
Object toObject(IFormComponent field, String input) throws ValidatorException
The input string will already have been trimmed. It may be null.
ValidatorException
- if the string cannot be converted into an object, or the object is not valid (due
to other constraints).void renderValidatorContribution(IFormComponent field, IMarkupWriter writer, IRequestCycle cycle)
void setScriptSource(IScriptSource scriptSource)
scriptSource
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |