public abstract class BaseMetadataTypeGsonTypeAdapter extends com.google.gson.TypeAdapter<MetadataType>
Gson TypeAdapter that helps to serialize and deserialize MetadataType objects.
TypeAdapter implementation is done in this base class, concrete implementations should provide a
MetadataTypeWriter and a SerializedMetadataTypeLoader implementations that actually know how to
serialize/deserialize the MetadataType in some JSON structure.
| Constructor and Description |
|---|
BaseMetadataTypeGsonTypeAdapter(MetadataTypeWriter writer,
SerializedMetadataTypeLoader loader) |
| Modifier and Type | Method and Description |
|---|---|
MetadataType |
read(com.google.gson.stream.JsonReader jsonReader)
Uses the
JsonReader containing the JSON representation of a MetadataType, it gets deserialized and returns
the instance. |
void |
setAllowNullInput(boolean allowNullInput) |
void |
write(com.google.gson.stream.JsonWriter jsonWriter,
MetadataType metadataType)
Given a
MetadataType as parameter, this serializes it, and writes the Json object using the |
public BaseMetadataTypeGsonTypeAdapter(MetadataTypeWriter writer, SerializedMetadataTypeLoader loader)
public void write(com.google.gson.stream.JsonWriter jsonWriter,
MetadataType metadataType)
throws IOException
MetadataType as parameter, this serializes it, and writes the Json object using the write in class com.google.gson.TypeAdapter<MetadataType>jsonWriter - JsonWriter instance to write the serialized object into JsonmetadataType - MetadataType instance to doSerializeIOExceptionpublic MetadataType read(com.google.gson.stream.JsonReader jsonReader) throws IOException
JsonReader containing the JSON representation of a MetadataType, it gets deserialized and returns
the instance.read in class com.google.gson.TypeAdapter<MetadataType>jsonReader - which contains as root level the JSON representation of a MetadataTypeMetadataType instance that represents the deserialized value of the JSON object.IOExceptionpublic void setAllowNullInput(boolean allowNullInput)
Copyright © 2024 MuleSoft, Inc.. All rights reserved.