Class LegacyNestedElementModelTypeAdapter

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

public class LegacyNestedElementModelTypeAdapter 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-19605.

TL;DR, NestableElementModel now has the NestedRouteModel.getMinOccurs() and NestedRouteModel.getMaxOccurs() concepts.

This adapter allows to still being able to read serialized models which don't contain such properties, by inferring them based on the NestableElementModel.isRequired() property.

Since:
1.4.0
  • Constructor Summary

    Constructors
    Constructor
    Description
    LegacyNestedElementModelTypeAdapter(com.google.gson.TypeAdapter<org.mule.runtime.api.meta.model.nested.NestableElementModel> delegate)
     
  • 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

    • LegacyNestedElementModelTypeAdapter

      public LegacyNestedElementModelTypeAdapter(com.google.gson.TypeAdapter<org.mule.runtime.api.meta.model.nested.NestableElementModel> delegate)
  • 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