java.lang.Object
com.google.gson.TypeAdapter<T>
org.mule.runtime.extension.internal.persistence.SourceModelTypeAdapter

public class SourceModelTypeAdapter extends com.google.gson.TypeAdapter<T>
A TypeAdapter for serializing instances of SourceModel and all its child interfaces
Since:
1.0
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected final com.google.gson.Gson
     
    protected static final String
     
    protected final com.google.gson.TypeAdapterFactory
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    SourceModelTypeAdapter(com.google.gson.TypeAdapterFactory typeAdapterFactory, com.google.gson.Gson gson)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected com.google.gson.TypeAdapter<org.mule.runtime.api.meta.model.source.SourceModel>
    Returns a TypeAdapter parameterized with the Class from a String with the kind property
    protected String
    getKind(org.mule.runtime.api.meta.model.source.SourceModel value)
     
    org.mule.runtime.api.meta.model.source.SourceModel
    read(com.google.gson.stream.JsonReader in)
     
    void
    write(com.google.gson.stream.JsonWriter out, org.mule.runtime.api.meta.model.source.SourceModel value)
     

    Methods inherited from class com.google.gson.TypeAdapter

    fromJson, fromJson, fromJsonTree, nullSafe, toJson, toJson, toJsonTree

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • KIND

      protected static final String KIND
      See Also:
    • typeAdapterFactory

      protected final com.google.gson.TypeAdapterFactory typeAdapterFactory
    • gson

      protected final com.google.gson.Gson gson
  • Constructor Details

    • SourceModelTypeAdapter

      public SourceModelTypeAdapter(com.google.gson.TypeAdapterFactory typeAdapterFactory, com.google.gson.Gson gson)
  • Method Details

    • getKind

      protected String getKind(org.mule.runtime.api.meta.model.source.SourceModel value)
    • getDelegateAdapter

      protected com.google.gson.TypeAdapter<org.mule.runtime.api.meta.model.source.SourceModel> getDelegateAdapter(String kind)
      Returns a TypeAdapter parameterized with the Class from a String with the kind property
    • write

      public void write(com.google.gson.stream.JsonWriter out, org.mule.runtime.api.meta.model.source.SourceModel value) throws IOException
      Specified by:
      write in class com.google.gson.TypeAdapter<T>
      Throws:
      IOException
    • read

      public org.mule.runtime.api.meta.model.source.SourceModel read(com.google.gson.stream.JsonReader in) throws IOException
      Specified by:
      read in class com.google.gson.TypeAdapter<T>
      Throws:
      IOException