Class ModelPropertyMapTypeAdapter
public final class ModelPropertyMapTypeAdapter
extends com.google.gson.TypeAdapter<Map<Class<? extends org.mule.runtime.api.meta.model.ModelProperty>,org.mule.runtime.api.meta.model.ModelProperty>>
TypeAdapter implementation that knows how to serialize and deserialize
Map<Class<? extends ModelProperty>, ModelProperty>. This TypeAdapter has been created at this level, and not
just a com.google.gson.TypeAdapter<org.mule.runtime.api.meta.model.ModelProperty>, to be able to easily tag every object with a representative name of the class.
Due to the nature of ModelProperty, that can be dynamically attached to any EnrichableModel, only the already
know set of ModelProperty will be tagged with a friendly name, example: LayoutModel is going to be identified
with the display name. Otherwise, the ModelProperty will be serialized tagging it with the full qualifier name
of the class.
When deserializing a ModelPropertys, their full qualified name will be used, if the class is not found in the
ClassLoader the ModelProperty object will be discarded
- Since:
- 1.0
-
Method Summary
Modifier and TypeMethodDescriptionMap<Class<? extends org.mule.runtime.api.meta.model.ModelProperty>,org.mule.runtime.api.meta.model.ModelProperty> read(com.google.gson.stream.JsonReader in) voidwrite(com.google.gson.stream.JsonWriter out, Map<Class<? extends org.mule.runtime.api.meta.model.ModelProperty>, org.mule.runtime.api.meta.model.ModelProperty> modelPropertyMap) Methods inherited from class com.google.gson.TypeAdapter
fromJson, fromJson, fromJsonTree, nullSafe, toJson, toJson, toJsonTree
-
Method Details
-
write
public void write(com.google.gson.stream.JsonWriter out, Map<Class<? extends org.mule.runtime.api.meta.model.ModelProperty>, org.mule.runtime.api.meta.model.ModelProperty> modelPropertyMap) throws IOException- Specified by:
writein classcom.google.gson.TypeAdapter<Map<Class<? extends org.mule.runtime.api.meta.model.ModelProperty>,org.mule.runtime.api.meta.model.ModelProperty>> - Throws:
IOException
-
read
public Map<Class<? extends org.mule.runtime.api.meta.model.ModelProperty>,org.mule.runtime.api.meta.model.ModelProperty> read(com.google.gson.stream.JsonReader in) throws IOException - Specified by:
readin classcom.google.gson.TypeAdapter<Map<Class<? extends org.mule.runtime.api.meta.model.ModelProperty>,org.mule.runtime.api.meta.model.ModelProperty>> - Throws:
IOException
-