Class FieldTranslatorImpl<T>
java.lang.Object
org.apache.tapestry5.internal.services.FieldTranslatorImpl<T>
- All Implemented Interfaces:
FieldTranslator<T>
-
Constructor Summary
ConstructorsConstructorDescriptionFieldTranslatorImpl(Field field, Translator<T> translator, MessageFormatter formatter, FormSupport formSupport) -
Method Summary
Modifier and TypeMethodDescriptiongetType()Returns the type of the server-side value.Invoked after the client-submitted value has beentranslatedto check that the value conforms to expectations (often, in terms of minimum or maximum value).voidrender(MarkupWriter writer) Converts a server-side value to a client-side string.
-
Constructor Details
-
FieldTranslatorImpl
public FieldTranslatorImpl(Field field, Translator<T> translator, MessageFormatter formatter, FormSupport formSupport)
-
-
Method Details
-
parse
Description copied from interface:FieldTranslatorInvoked after the client-submitted value has beentranslatedto 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:
parsein interfaceFieldTranslator<T>- Throws:
ValidationException- if the value violates the constraint
-
render
Description copied from interface:FieldTranslatorInvokesTranslator.render(Field, String, 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 underlyingValidatormay write client-side JavaScript to enforce the constraint as well.- Specified by:
renderin interfaceFieldTranslator<T>- Parameters:
writer- markup writer to direct output to.- See Also:
-
toClient
Description copied from interface:FieldTranslatorConverts a server-side value to a client-side string. This allows for formatting of the value in a way appropriate to the end user.- Specified by:
toClientin interfaceFieldTranslator<T>- Parameters:
value- the server side value (which will not be null)- Returns:
- client-side value to present to the user
- See Also:
-
getType
Description copied from interface:FieldTranslatorReturns the type of the server-side value.- Specified by:
getTypein interfaceFieldTranslator<T>- Returns:
- a type
-