Class LegacyNestedRouteModelTypeAdapter

java.lang.Object
com.google.gson.TypeAdapter<org.mule.runtime.api.meta.model.nested.NestableElementModel>
org.mule.runtime.extension.internal.persistence.LegacyNestedRouteModelTypeAdapter

public class LegacyNestedRouteModelTypeAdapter extends com.google.gson.TypeAdapter<org.mule.runtime.api.meta.model.nested.NestableElementModel>
This type adapter maintains backwards compatibility at the serialization levels after the changes done in MULE-19579.

TL;DR, NestableElementModel has been promoted to ComponentModel which transforms the element models into composites. This is a problem for the particular case of NestedRouteModel since it already was a composite, whose children were serialized under the key nestedComponents. Because of this change, that key would change to childComponents. This type adapter preserves the old name allowing existing clients to still be able to deserialize old instances.

Since:
1.4.0
  • Constructor Summary

    Constructors
    Constructor
    Description
    LegacyNestedRouteModelTypeAdapter(com.google.gson.TypeAdapter<org.mule.runtime.api.meta.model.nested.NestableElementModel> delegate, com.google.gson.Gson gson)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    org.mule.runtime.api.meta.model.nested.NestableElementModel
    read(com.google.gson.stream.JsonReader in)
     
    void
    write(com.google.gson.stream.JsonWriter out, org.mule.runtime.api.meta.model.nested.NestableElementModel 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
  • Constructor Details

    • LegacyNestedRouteModelTypeAdapter

      public LegacyNestedRouteModelTypeAdapter(com.google.gson.TypeAdapter<org.mule.runtime.api.meta.model.nested.NestableElementModel> delegate, com.google.gson.Gson gson)
  • Method Details

    • write

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

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