public class NumericTranslatorSupportImpl extends Object implements NumericTranslatorSupport
| Constructor and Description |
|---|
NumericTranslatorSupportImpl(TypeCoercer typeCoercer,
ThreadLocale threadLocale,
JavaScriptSupport javascriptSupport) |
| Modifier and Type | Method and Description |
|---|---|
<T extends Number> |
getMessageKey(Class<T> type)
Returns the default message key for parse failures for the indicated type.
|
<T extends Number> |
parseClient(Class<T> type,
String clientValue)
Parses a client-submitted value in a localized manner.
|
<T extends Number> |
setupTranslation(Class<T> type,
Element element,
String message)
Adds client-side format validation for the field, appropriate to the indicated type.
|
<T extends Number> |
toClient(Class<T> type,
T value)
Converts a server-side value to a client-side string.
|
public NumericTranslatorSupportImpl(TypeCoercer typeCoercer, ThreadLocale threadLocale, JavaScriptSupport javascriptSupport)
public <T extends Number> void setupTranslation(Class<T> type, Element element, String message)
NumericTranslatorSupportsetupTranslation in interface NumericTranslatorSupporttype - value typemessage - message if the client-side value can't be parsed as a numberpublic <T extends Number> T parseClient(Class<T> type, String clientValue) throws ParseException
NumericTranslatorSupportparseClient in interface NumericTranslatorSupporttype - desired type of valueclientValue - value from client; this will be trimmed of leading/trailing whitespaceParseExceptionTranslator.parseClient(org.apache.tapestry5.Field, String, String)public <T extends Number> String toClient(Class<T> type, T value)
NumericTranslatorSupporttoClient in interface NumericTranslatorSupporttype - type of value to convertvalue - current (non-null) valuepublic <T extends Number> String getMessageKey(Class<T> type)
NumericTranslatorSupportgetMessageKey in interface NumericTranslatorSupport5.6.4 - Copyright © 2003-2021 The Apache Software Foundation.