cfboom.gson

Class DefaultTypeAdapter

lucee.Component
    extended by cfboom.lang.Object
      extended by cfboom.gson.TypeAdapter
        extended by cfboom.gson.DefaultTypeAdapter
All Implemented Interfaces:
InstanceCreator , JsonDeserializer , JsonSerializer

Default implementation of TypeAdapter.

Class Attributes:
  • singleton : true
  •  
  • output : false
  •  
  • displayname : Class DefaultTypeAdapter
  •  
  • synchronized : false
  •  
  • accessors : false
  •  
  • persistent : false
  •  
  • author : Joel Tobey
  •  
    Property Summary
    type property default serializable required
    any log


    • access = public
    • returntype = any
    • inject = logbox:logger:{this}
    true false
    any wirebox


    • access = public
    • returntype = any
    • inject = wirebox
    true false
    Constructor Summary
    init()
          Constructor.
    Method Summary
    any createInstance(string class)
         Default implementation returns wirebox.
    any serialize(any src, [string typeOfSrc])
         Super basic implementation.
     
    Methods inherited from class cfboom.gson.TypeAdapter
    deserialize
     
    Methods inherited from class cfboom.lang.Object
    $equals, getComponentName, getIdentityHashCode, getIdentityString, getMeta, hashCode, toString
     
    Methods inherited from class lucee.Component
    None

    Constructor Detail

    init

    public init()

    Constructor.


    Property Detail

    log

    property any log

    Attributes:
    access - public
    required - false
    returntype - any
    inject - logbox:logger:{this}
    serializable - true

    wirebox

    property any wirebox

    Attributes:
    access - public
    required - false
    returntype - any
    inject - wirebox
    serializable - true

    Method Detail

    createInstance

    public any createInstance(string class)

    Default implementation returns wirebox.getInstance( class );

    Overrides:
    createInstance in class TypeAdapter
    Parameters:
    class
    Returns:
    a wired up class from wirebox.

    serialize

    public any serialize(any src, [string typeOfSrc])

    Super basic implementation. Looks for toGson() method on src. Otherwise, it uses serializeJson().

    Overrides:
    serialize in class TypeAdapter
    Parameters:
    src
    typeOfSrc