Class GsonConverter

java.lang.Object
org.zkoss.zkmax.bind.GsonConverter
All Implemented Interfaces:
Converter<Object,Object,Component>
Direct Known Subclasses:
GsonConverter

public class GsonConverter extends Object implements Converter<Object,Object,Component>
A Gson converter for Binding Parameter
Since:
8.0.0
Author:
jumperchen
  • Constructor Details

    • GsonConverter

      public GsonConverter()
  • Method Details

    • coerceToUi

      public Object coerceToUi(Object beanProp, Component component, BindContext ctx)
      Description copied from interface: Converter
      Coerces a value to another value to load to a component
      Specified by:
      coerceToUi in interface Converter<Object,Object,Component>
      Parameters:
      beanProp - the bean value
      component - the component to be loaded the value
      ctx - the bind context
      Returns:
      the value to load to a component
    • coerceToBean

      public Object coerceToBean(Object compAttr, Component component, BindContext ctx)
      Description copied from interface: Converter
      Coerces a value to bean value to save to a bean
      Specified by:
      coerceToBean in interface Converter<Object,Object,Component>
      Parameters:
      compAttr - the value of component attribute.
      component - the component provides the value
      ctx - the bind context
      Returns:
      the value to save to a bean