Class HibernateEntityValueEncoder<E>
- java.lang.Object
-
- org.apache.tapestry5.hibernate.web.internal.HibernateEntityValueEncoder<E>
-
- All Implemented Interfaces:
ValueEncoder<E>
public final class HibernateEntityValueEncoder<E> extends java.lang.Object implements ValueEncoder<E>
-
-
Constructor Summary
Constructors Constructor Description HibernateEntityValueEncoder(java.lang.Class<E> entityClass, java.lang.String identifierPropertyName, org.hibernate.Session session, PropertyAccess propertyAccess, TypeCoercer typeCoercer, org.slf4j.Logger logger)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringtoClient(E value)Converts a value into a client-side representation.EtoValue(java.lang.String clientValue)Converts a client-side representation, provided byValueEncoder.toClient(Object), back into a server-side value.
-
-
-
Constructor Detail
-
HibernateEntityValueEncoder
public HibernateEntityValueEncoder(java.lang.Class<E> entityClass, java.lang.String identifierPropertyName, org.hibernate.Session session, PropertyAccess propertyAccess, TypeCoercer typeCoercer, org.slf4j.Logger logger)
-
-
Method Detail
-
toClient
public java.lang.String toClient(E value)
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>- Parameters:
value- to be encoded- Returns:
- a string representation of the value, or the value's identity
-
toValue
public E toValue(java.lang.String clientValue)
Description copied from interface:ValueEncoderConverts a client-side representation, provided byValueEncoder.toClient(Object), back into a server-side value.- Specified by:
toValuein interfaceValueEncoder<E>- Parameters:
clientValue- string representation of the value's identity- Returns:
- the corresponding entity, or null if not found
-
-