|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
T
- public interface Translator<T>
Translates between client-side and server-side values. Client-side values are always strings.
TranslatorSource
,
FieldValidationSupport
,
FieldTranslator
Method Summary | |
---|---|
String |
getMessageKey()
Returns the message key, within the application's global message catalog, normally used by this validator. |
String |
getName()
Returns a unique name for the translator. |
Class<T> |
getType()
Returns the type of the server-side value. |
T |
parseClient(Field field,
String clientValue,
String message)
Converts a submitted request value into an appropriate server side value. |
void |
render(Field field,
String message,
MarkupWriter writer,
FormSupport formSupport)
Hook used by components to allow the validator to contribute additional attributes or (more often) client-side JavaScript (via the FormSupport.addValidation(Field, String, String, Object) ). |
String |
toClient(T value)
Converts a server-side value to a client-side string. |
Method Detail |
---|
String getName()
String toClient(T value)
parseClient(Field, String, String)
.
value
- the server side value (which will not be null)
Class<T> getType()
String getMessageKey()
parseClient(Field, String, String)
or
render(Field, String, MarkupWriter, org.apache.tapestry5.services.FormSupport)
.
T parseClient(Field field, String clientValue, String message) throws ValidationException
field
- for which a value is being parsedclientValue
- to convert to a server value; this will not be null, but may be blankmessage
- formatted validation message, either from validation messages, or from an override
ValidationException
- if the value can not be parsedvoid render(Field field, String message, MarkupWriter writer, FormSupport formSupport)
FormSupport.addValidation(Field, String, String, Object)
).
field
- the field which is currently being renderedmessage
- formatted validation message, either from validation messages, or from an overridewriter
- markup writer, allowing additional attributes to be written into the active elementformSupport
- used to add JavaScript
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |