Interface IGsonFactory


public interface IGsonFactory
*** FOR INTERNAL USE ONLY!! DEVELOPER CODE SHOULD NEVER DIRECTLY USE THIS INTERFACE! ***
Factory for making a customized Gson instance for the system.
Author:
swong
  • Method Summary

    Static Methods
    Modifier and Type Method Description
    static com.google.gson.Gson make​(ICefUtils cefUtils)
    *** FOR INTERNAL USE ONLY!! DEVELOPER CODE SHOULD NEVER DIRECTLY USE THIS METHOD! ***
    Instantiate a new Gson object customized for the CEF system.
    static com.google.gson.TypeAdapterFactory makeMapComponentsTypeAdapterFactory()
    *** FOR INTERNAL USE ONLY!! DEVELOPER CODE SHOULD NEVER DIRECTLY USE THIS METHOD! ***
    Factory method for a TypeAdapterFactory for various map components Currently implemented type processing: ILatLng: (r/w) Converts to/from JSON dictionary with keys = ("lat", "lng"). ILatLngBounds: (w) Converts to JSON dictionary with keys = ("north, "east", "south", "west"). IMouseEvent: (read only) Reads "latLng" field from JSON object into a new IMouseEvent object IPolyMouseEvent: (read only) Reads "latLng", edge, path and vertex fields from JSON object into a new IPolyMouseEvent object
  • Method Details

    • make

      static com.google.gson.Gson make​(ICefUtils cefUtils)
      *** FOR INTERNAL USE ONLY!! DEVELOPER CODE SHOULD NEVER DIRECTLY USE THIS METHOD! ***
      Instantiate a new Gson object customized for the CEF system. Uses both TypeAdapter and TypeAdapterFactory (recommended) instances to create converters from various system classes to JSON. If new classes are added to the system that need to be converted to JSON, this factory method must be modified. Currently implemented type processing:
      • Runnable: (write only) Registers given Runnable with ICefUtils and then creates JSON object with identifier info.
      • Consumer: (write only) Registers given Runnable with ICefUtils and then creates JSON object with identifier info.
      • ICefObject: (write only) Creates JSON object with the object's unique ID value
      • ICefObjRef: (write only) Creates JSON object with the object's unique ID value
      • UUID: (r/w) Converts UUID to/from string representation.
      • IIconSequence: (w) Converts an options dictionary to a wrapper object holding the options dictionary
      • IPathLatLng: (r/w) Explicit type for IPath<ILatLng> to convert to/from an array of LatLngs
      • IPathsLatLng: (r/w) Explicit type for IPaths<ILatLng> to convert to/from an array of or array of arrays of ILatLngs
      • ISymbol: (w) Converts an options dictionary to a wrapper object holding the options dictionary
      • ISymbolPath: (w) Writes out the name or path string depending on its sub-type.
      • Component Options: (write only) Converts IMixedDataDictionary into a JSON dictionary. Implemented option types:
        • ICircleOptions
        • IGroundOverlayOptions
        • IIconOptions
        • IIconSequenceOptions
        • IInfoWindowOptions
        • IMapOptions
        • IMapDataStyleOptions
        • IMarkerOptions
        • IMarkerLabelOptions
        • IPolygonOptions
        • IPolylineOptions
        • IRectangleOptions
        • ISymbolOptions
      • Map components: See the documentation for makeMapComponentsTypeAdapterFactory()
      • GsonTypeWrap: (write only) Converts to JSON as per the contained type information.
      TODO: Move this implementation to its own CEF-specific singleton and enable it to be more easily extended.
      Parameters:
      cefUtils - CEF utilities that are used by the conversion processes.
      Returns:
      A new customized Gson instance.
    • makeMapComponentsTypeAdapterFactory

      static com.google.gson.TypeAdapterFactory makeMapComponentsTypeAdapterFactory()
      *** FOR INTERNAL USE ONLY!! DEVELOPER CODE SHOULD NEVER DIRECTLY USE THIS METHOD! ***
      Factory method for a TypeAdapterFactory for various map components Currently implemented type processing:
      • ILatLng: (r/w) Converts to/from JSON dictionary with keys = ("lat", "lng").
      • ILatLngBounds: (w) Converts to JSON dictionary with keys = ("north, "east", "south", "west").
      • IMouseEvent: (read only) Reads "latLng" field from JSON object into a new IMouseEvent object
      • IPolyMouseEvent: (read only) Reads "latLng", edge, path and vertex fields from JSON object into a new IPolyMouseEvent object
      Returns:
      a TypeAdapterFactory instance