Class ComponentResultJsonSerializer<T extends org.mule.runtime.api.meta.model.ComponentModel>
java.lang.Object
org.mule.runtime.extension.api.persistence.metadata.ComponentResultJsonSerializer<T>
public class ComponentResultJsonSerializer<T extends org.mule.runtime.api.meta.model.ComponentModel>
extends Object
Serializer that can convert a
MetadataResult of a ComponentMetadataDescriptor type into a readable and
processable JSON representation and from a JSON String to an MetadataResult instance- Since:
- 1.0
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionComponentResultJsonSerializer(boolean prettyPrint) ComponentResultJsonSerializer(boolean prettyPrint, boolean reduced) -
Method Summary
Modifier and TypeMethodDescriptionorg.mule.runtime.api.metadata.resolving.MetadataResult<org.mule.runtime.api.metadata.descriptor.ComponentMetadataDescriptor<T>>deserialize(String metadataResult) Deserializes a JSON representation of anMetadataResult, to an actual instance of it.
-
Field Details
-
gson
protected final com.google.gson.Gson gson
-
-
Constructor Details
-
ComponentResultJsonSerializer
public ComponentResultJsonSerializer() -
ComponentResultJsonSerializer
public ComponentResultJsonSerializer(boolean prettyPrint) -
ComponentResultJsonSerializer
public ComponentResultJsonSerializer(boolean prettyPrint, boolean reduced)
-
-
Method Details
-
serialize
public String serialize(org.mule.runtime.api.metadata.resolving.MetadataResult<org.mule.runtime.api.metadata.descriptor.ComponentMetadataDescriptor<T>> metadataResult) - Parameters:
metadataResult- theMetadataResultto be serialized- Returns:
StringJSON representation of theMetadataResult
-
deserialize
public org.mule.runtime.api.metadata.resolving.MetadataResult<org.mule.runtime.api.metadata.descriptor.ComponentMetadataDescriptor<T>> deserialize(String metadataResult) Deserializes a JSON representation of anMetadataResult, to an actual instance of it.- Parameters:
metadataResult- the serializedMetadataResultin aStringJSON representation- Returns:
- an instance of
MetadataResultbased on the serialized JSON
-