|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.tapestry5.internal.translator.NumericTranslatorSupportImpl
public class NumericTranslatorSupportImpl
Constructor Summary | |
---|---|
NumericTranslatorSupportImpl(TypeCoercer typeCoercer,
ThreadLocale threadLocale,
Request request,
JavaScriptSupport javascriptSupport,
ClientBehaviorSupport clientBehaviorSupport,
boolean compactJSON)
|
Method Summary | ||
---|---|---|
|
addValidation(java.lang.Class<T> type,
Field field,
java.lang.String message)
Adds client-side format validation for the field, appropriate to the indicated type. |
|
|
getMessageKey(java.lang.Class<T> type)
Returns the default message key for parse failures for the indicated type. |
|
|
parseClient(java.lang.Class<T> type,
java.lang.String clientValue)
Parses a client-submitted value in a localized manner. |
|
|
toClient(java.lang.Class<T> type,
T value)
Converts a server-side value to a client-side string. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public NumericTranslatorSupportImpl(TypeCoercer typeCoercer, ThreadLocale threadLocale, Request request, JavaScriptSupport javascriptSupport, ClientBehaviorSupport clientBehaviorSupport, @Symbol(value="tapestry.compact-json") boolean compactJSON)
Method Detail |
---|
public <T extends java.lang.Number> void addValidation(java.lang.Class<T> type, Field field, java.lang.String message)
NumericTranslatorSupport
addValidation
in interface NumericTranslatorSupport
type
- value typefield
- field to which validation should be addedmessage
- message if the client-side value can't be parsed as a numberpublic <T extends java.lang.Number> T parseClient(java.lang.Class<T> type, java.lang.String clientValue) throws java.text.ParseException
NumericTranslatorSupport
parseClient
in interface NumericTranslatorSupport
type
- desired type of valueclientValue
- value from client; this will be trimmed of leading/trailing whitespace
java.text.ParseException
Translator.parseClient(org.apache.tapestry5.Field, String, String)
public <T extends java.lang.Number> java.lang.String toClient(java.lang.Class<T> type, T value)
NumericTranslatorSupport
toClient
in interface NumericTranslatorSupport
type
- type of value to convertvalue
- current (non-null) value
public <T extends java.lang.Number> java.lang.String getMessageKey(java.lang.Class<T> type)
NumericTranslatorSupport
getMessageKey
in interface NumericTranslatorSupport
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |