Package org.mule.metadata.persistence
Class JsonMetadataTypeLoader
- java.lang.Object
-
- org.mule.metadata.persistence.JsonMetadataTypeLoader
-
- All Implemented Interfaces:
TypeLoader,SerializedMetadataTypeLoader
public class JsonMetadataTypeLoader extends Object implements SerializedMetadataTypeLoader
TypeLoaderthat creates instances ofMetadataTypefrom JSON representations generated byJsonMetadataTypeWriter.Instances of this class are not thread safe, so only one deserialization at a time can be made with each instance.
- Since:
- 1.0
-
-
Constructor Summary
Constructors Constructor Description JsonMetadataTypeLoader()Creates a new instance which serializes all types explicitly without handling referencesJsonMetadataTypeLoader(ObjectTypeReferenceHandler referenceHandler)Creates a new instance which handles type references through the givenreferenceHandler
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TypeBuilderbuildType(com.google.gson.JsonElement metadataTypeElement, BaseTypeBuilder baseBuilder)Optional<MetadataType>load(com.google.gson.JsonElement jsonElement)Parses aMetadataTypeJSON representation and returns a newMetadataTypeinstance.Optional<TypeBuilder>load(com.google.gson.JsonElement jsonElement, Stack<TypeBuilder> builderStack, Stack<MetadataFormat> formatStack)Optional<MetadataType>load(String typeIdentifier)Parses aMetadataTypeJSON representation and returns a newMetadataTypeinstance.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.mule.metadata.api.TypeLoader
load
-
-
-
-
Constructor Detail
-
JsonMetadataTypeLoader
public JsonMetadataTypeLoader()
Creates a new instance which serializes all types explicitly without handling references
-
JsonMetadataTypeLoader
public JsonMetadataTypeLoader(ObjectTypeReferenceHandler referenceHandler)
Creates a new instance which handles type references through the givenreferenceHandler- Parameters:
referenceHandler- anObjectTypeReferenceHandler
-
-
Method Detail
-
load
public Optional<MetadataType> load(String typeIdentifier)
Parses aMetadataTypeJSON representation and returns a newMetadataTypeinstance.- Specified by:
loadin interfaceTypeLoader- Parameters:
typeIdentifier-MetadataTypeJSON representation as aString- Returns:
Optionalvalue of aMetadataType
-
load
public Optional<MetadataType> load(com.google.gson.JsonElement jsonElement)
Parses aMetadataTypeJSON representation and returns a newMetadataTypeinstance.- Specified by:
loadin interfaceSerializedMetadataTypeLoader- Parameters:
jsonElement-MetadataTypeJSON representation as aJsonElement- Returns:
Optionalvalue of aMetadataType
-
load
public Optional<TypeBuilder> load(com.google.gson.JsonElement jsonElement, Stack<TypeBuilder> builderStack, Stack<MetadataFormat> formatStack)
-
buildType
public TypeBuilder buildType(com.google.gson.JsonElement metadataTypeElement, BaseTypeBuilder baseBuilder)
-
-