public interface TypeAnnotationSerializerExtender
MetadataType serialization. The implementation of
this class is highly recommended when using custom TypeAnnotations in a MetadataType description to be
able to create more human readable serialization output. This implementations will be located using SPI.| Modifier and Type | Method and Description |
|---|---|
default Collection<Object> |
getAdditionalFeatures()
Provides an unspecific list of additional serialization features.
|
default Map<String,Class<? extends TypeAnnotation>> |
getNameClassMapping()
The purpose of this registry is to provide a mapping between a "friendly name" (
TypeAnnotation.getName()) and
the correspondent concrete class (TypeAnnotation#getClass()), this allows to the serialization to write a more
compact and easy to read name, instead of using the full qualifier name of the concrete class. |
default Map<String,Class<? extends TypeAnnotation>> getNameClassMapping()
TypeAnnotation.getName()) and
the correspondent concrete class (TypeAnnotation#getClass()), this allows to the serialization to write a more
compact and easy to read name, instead of using the full qualifier name of the concrete class.
Using this mapping the serialization goes from:
{"org.mule.metadata.api.annotation.TypeIdAnnotation":"java.lang.String"}
To:
{"typeId":"java.lang.String"}
By default the MetadataType serialization will provide mappings for out of the box TypeAnnotation
implementations as TypeIdAnnotation, LabelAnnotation, etc.
Considerations:
TypeAnnotation.getName()TypeAnnotation the full qualifier name will be usedTypeAnnotation implementation, the
serialization will failTypeAnnotation implementation is not found in the in the ClassLoader, the
deserialization of this object will be ignored.default Collection<Object> getAdditionalFeatures()
Copyright © 2022 MuleSoft, Inc.. All rights reserved.