Package org.apache.tapestry5.util
Class EnumValueEncoder<E extends Enum<E>>
java.lang.Object
org.apache.tapestry5.util.EnumValueEncoder<E>
- All Implemented Interfaces:
ValueEncoder<E>
A value encoder that can be used for arbitrary Enum types. The enum name is stored as the client side value.
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
EnumValueEncoder
-
-
Method Details
-
toClient
Description copied from interface:ValueEncoderConverts a value into a client-side representation. The value should be parseable byValueEncoder.toValue(String). In some cases, what is returned is an identifier used to locate the true object, rather than a string representation of the value itself.- Specified by:
toClientin interfaceValueEncoder<E extends Enum<E>>- Parameters:
value- to be encoded- Returns:
- a string representation of the value, or the value's identity
-
toValue
Description copied from interface:ValueEncoderConverts a client-side representation, provided byValueEncoder.toClient(Object), back into a server-side value.- Specified by:
toValuein interfaceValueEncoder<E extends Enum<E>>- Parameters:
clientValue- string representation of the value's identity- Returns:
- the corresponding entity, or null if not found
-