org.apache.tapestry.internal.translator
Class LongTranslator

java.lang.Object
  extended by org.apache.tapestry.internal.translator.LongTranslator
All Implemented Interfaces:
Translator<Long>

public class LongTranslator
extends Object
implements Translator<Long>

A translator for type long.


Constructor Summary
LongTranslator()
           
 
Method Summary
 Class<Long> getType()
          Returns the type of the server-side value.
 Long parseClient(String clientValue, Messages messages)
          Parses blank values to null, otherwise parses the client value to a long
 String toClient(Long value)
          Converts null to the blank string, non-null to a string representation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LongTranslator

public LongTranslator()
Method Detail

getType

public Class<Long> getType()
Description copied from interface: Translator
Returns the type of the server-side value.

Specified by:
getType in interface Translator<Long>
Returns:
a type

parseClient

public Long parseClient(String clientValue,
                        Messages messages)
                 throws ValidationException
Parses blank values to null, otherwise parses the client value to a long

Specified by:
parseClient in interface Translator<Long>
Parameters:
clientValue - to convert to a server value; this will not be null, but may be blank
messages - validator messages assembled by ValidationMessagesSource
Returns:
equivalent server-side value (possibly null)
Throws:
ValidationException - if the clientValue can not be parsed

toClient

public String toClient(Long value)
Converts null to the blank string, non-null to a string representation.

Specified by:
toClient in interface Translator<Long>
Parameters:
value - the server side value (which will not be null)
Returns:
client-side value to present to the user


Copyright © 2006-2008 Apache Software Foundation. All Rights Reserved.