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
ConstructorsConstructorDescriptionLegacyNestedRouteModelTypeAdapter(com.google.gson.TypeAdapter<org.mule.runtime.api.meta.model.nested.NestableElementModel> delegate, com.google.gson.Gson gson) -
Method Summary
Methods inherited from class com.google.gson.TypeAdapter
fromJson, fromJson, fromJsonTree, nullSafe, toJson, toJson, toJsonTree
-
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:
writein classcom.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:
readin classcom.google.gson.TypeAdapter<org.mule.runtime.api.meta.model.nested.NestableElementModel>- Throws:
IOException
-