org.apache.tapestry.internal.translator
Class ByteTranslator

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

public class ByteTranslator
extends Object
implements Translator<Byte>


Constructor Summary
ByteTranslator()
           
 
Method Summary
 Class<Byte> getType()
          Returns the type of the server-side value.
 Byte parseClient(String clientValue, Messages messages)
          Converts a submitted request value into an appropriate server side value.
 String toClient(Byte 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

ByteTranslator

public ByteTranslator()
Method Detail

toClient

public String toClient(Byte value)
Description copied from interface: Translator
Converts a server-side value to a client-side string. This allows for formatting of the value in a way appropriate to the end user. The output client value should be parsable by Translator.parseClient(String, Messages).

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

getType

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

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

parseClient

public Byte parseClient(String clientValue,
                        Messages messages)
                 throws ValidationException
Description copied from interface: Translator
Converts a submitted request value into an appropriate server side value.

Specified by:
parseClient in interface Translator<Byte>
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 value can not be parsed


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