| 
||||||||||
| 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(Class<T> type,
                           Field field,
                           String message)
Adds client-side format validation for the field, appropriate to the indicated type.  | 
|
 | 
getMessageKey(Class<T> type)
Returns the default message key for parse failures for the indicated type.  | 
|
 | 
parseClient(Class<T> type,
                       String clientValue)
Parses a client-submitted value in a localized manner.  | 
|
 | 
toClient(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 Number> void addValidation(Class<T> type,
                                             Field field,
                                             String message)
NumericTranslatorSupport
addValidation in interface NumericTranslatorSupporttype - value typefield - field to which validation should be addedmessage - message if the client-side value can't be parsed as a number
public <T extends Number> T parseClient(Class<T> type,
                                        String clientValue)
                             throws ParseException
NumericTranslatorSupport
parseClient in interface NumericTranslatorSupporttype - desired type of valueclientValue - value from client; this will be trimmed of leading/trailing whitespace
ParseExceptionTranslator.parseClient(org.apache.tapestry5.Field, String, String)
public <T extends Number> String toClient(Class<T> type,
                                          T value)
NumericTranslatorSupport
toClient in interface NumericTranslatorSupporttype - type of value to convertvalue - current (non-null) value
public <T extends Number> String getMessageKey(Class<T> type)
NumericTranslatorSupport
getMessageKey in interface NumericTranslatorSupport
  | 
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||