Class GsonConverter

  • All Implemented Interfaces:
    Converter<java.lang.Object,​java.lang.Object,​Component>
    Direct Known Subclasses:
    GsonConverter

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

      Constructors 
      Constructor Description
      GsonConverter()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Object coerceToBean​(java.lang.Object compAttr, Component component, BindContext ctx)
      Coerces a value to bean value to save to a bean
      java.lang.Object coerceToUi​(java.lang.Object beanProp, Component component, BindContext ctx)
      Coerces a value to another value to load to a component
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • GsonConverter

        public GsonConverter()
    • Method Detail

      • coerceToUi

        public java.lang.Object coerceToUi​(java.lang.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<java.lang.Object,​java.lang.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 java.lang.Object coerceToBean​(java.lang.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<java.lang.Object,​java.lang.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