Save This Page
Home » tapestry-src-5.0.19 » org.apache.tapestry5 » [javadoc | source]
org.apache.tapestry5
public interface: ValueEncoder [javadoc | source]

All Known Implementing Classes:
    StringValueEncoder, EnumValueEncoder, HibernateEntityValueEncoder

Used to convert server side values to client-side strings. This is used when generating a org.apache.tapestry5.EventContext as part of a URL, or when components (such as org.apache.tapestry5.corelib.components.Select ) generated other client-side strings.

Often a custom implementation is needed for entity type objects, where the #toClient(Object) method extracts a primary key, and the #toValue(String) re-acquires the corresponding entity object.

Method from org.apache.tapestry5.ValueEncoder Summary:
toClient,   toValue
Method from org.apache.tapestry5.ValueEncoder Detail:
 public String toClient(V value)
    Converts a value into a client-side representation. The value should be parseable by #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.
 public V toValue(String clientValue)
    Converts a client-side representation, provided by #toClient(Object) , back into a server-side value.