public class JsonMetadataTypeLoader extends Object implements SerializedMetadataTypeLoader
TypeLoader that creates instances of MetadataType from JSON representations generated by
JsonMetadataTypeWriter.
Instances of this class are not thread safe, so only one deserialization at a time can be made with each instance.
| Constructor and Description |
|---|
JsonMetadataTypeLoader()
Creates a new instance which serializes all types explicitly without handling references
|
JsonMetadataTypeLoader(ObjectTypeReferenceHandler referenceHandler)
Creates a new instance which handles type references through the given
referenceHandler |
| Modifier and Type | Method and Description |
|---|---|
TypeBuilder |
buildType(com.google.gson.JsonElement metadataTypeElement,
BaseTypeBuilder baseBuilder) |
Optional<MetadataType> |
load(com.google.gson.JsonElement jsonElement)
Parses a
MetadataType JSON representation and returns a new MetadataType instance. |
Optional<TypeBuilder> |
load(com.google.gson.JsonElement jsonElement,
Stack<TypeBuilder> builderStack,
Stack<MetadataFormat> formatStack) |
Optional<MetadataType> |
load(String typeIdentifier)
Parses a
MetadataType JSON representation and returns a new MetadataType instance. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitloadpublic JsonMetadataTypeLoader()
public JsonMetadataTypeLoader(ObjectTypeReferenceHandler referenceHandler)
referenceHandlerreferenceHandler - an ObjectTypeReferenceHandlerpublic Optional<MetadataType> load(String typeIdentifier)
MetadataType JSON representation and returns a new MetadataType instance.load in interface TypeLoadertypeIdentifier - MetadataType JSON representation as a StringOptional value of a MetadataTypepublic Optional<MetadataType> load(com.google.gson.JsonElement jsonElement)
MetadataType JSON representation and returns a new MetadataType instance.load in interface SerializedMetadataTypeLoaderjsonElement - MetadataType JSON representation as a JsonElementOptional value of a MetadataTypepublic Optional<TypeBuilder> load(com.google.gson.JsonElement jsonElement, Stack<TypeBuilder> builderStack, Stack<MetadataFormat> formatStack)
public TypeBuilder buildType(com.google.gson.JsonElement metadataTypeElement, BaseTypeBuilder baseBuilder)
Copyright © 2022 MuleSoft, Inc.. All rights reserved.