Package org.apache.tapestry5.services

## Interface ContextValueEncoder

- All Known Subinterfaces:
    `ComponentPageElementResources`
  All Known Implementing Classes:
    `ComponentPageElementResourcesImpl`, `ContextValueEncoderImpl`

      public interface ContextValueEncoder

  Used to convert values used in event contexts to client string representations and back.
  See Also:
    `ValueEncoder`, `TypeCoercer`

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `java.lang.String` | `toClient​(java.lang.Object value)` | Converts a context value into a client-side string (that will ultimately be encoded into a URL).
    `<T> T` | `toValue​(java.lang.Class<T> requiredType, java.lang.String clientValue)` | Converts a client value back into a server-side object.

- - ### Method Detail

    - #### toClient

          java.lang.String toClient​(java.lang.Object value)

      Converts a context value into a client-side string (that will ultimately be encoded into a URL).
      Parameters:
        `value` - to convert (may not be null)
      Returns:
        string representation of the value
      See Also:
        `ValueEncoder.toClient(Object)`

    - #### toValue

          <T> T toValue​(java.lang.Class<T> requiredType,
                        java.lang.String clientValue)

      Converts a client value back into a server-side object.
      Parameters:
        `requiredType` - required type to convert the string to
        `clientValue` - value obtained from context passed from client
      Returns:
        the client value converted or coerced into a server value
      See Also:
        `ValueEncoder.toValue(String)`