public final class TypeAnnotationSerializer extends Object
TypeAnnotation.| Constructor and Description |
|---|
TypeAnnotationSerializer(Map<String,Class<? extends TypeAnnotation>> stingClassMapping,
Collection<Object> additionalFeatures,
TypeAnnotationSerializerExtenderFallback typeAnnotationSerializerExtenderFallback) |
| Modifier and Type | Method and Description |
|---|---|
<T extends TypeAnnotation> |
deserialize(String typeAnnotationName,
String json)
Deserializes a
TypeAnnotation implementation. |
Map<Class<? extends TypeAnnotation>,String> |
getClassNameMapping() |
Map<String,Class<? extends TypeAnnotation>> |
getNameClassMapping() |
<T extends TypeAnnotation> |
serialize(com.google.gson.stream.JsonWriter jsonWriter,
T typeAnnotation)
Serializes a
TypeAnnotation implementation. |
public TypeAnnotationSerializer(Map<String,Class<? extends TypeAnnotation>> stingClassMapping, Collection<Object> additionalFeatures, TypeAnnotationSerializerExtenderFallback typeAnnotationSerializerExtenderFallback)
public <T extends TypeAnnotation> Optional<T> deserialize(String typeAnnotationName, String json)
TypeAnnotation implementation.typeAnnotationName - name of the TypeAnnotation that match with TypeAnnotation.getName() or their full
qualifier class namejson - String representation of the serialized TypeAnnotationOptional with the deserialized TypeAnnotation in case that the deserialization
could not be done, Optional.empty() will be returnedpublic <T extends TypeAnnotation> void serialize(com.google.gson.stream.JsonWriter jsonWriter, T typeAnnotation)
TypeAnnotation implementation.jsonWriter - JsonWriter to write the serialized TypeAnnotationtypeAnnotation - TypeAnnotation implementation to serializedpublic Map<String,Class<? extends TypeAnnotation>> getNameClassMapping()
Map that links a friendly name with a TypeAnnotation class. This is helpful when deserializing a
TypeAnnotation to be able to create the correct instance type.public Map<Class<? extends TypeAnnotation>,String> getClassNameMapping()
Map that links a TypeAnnotation class with their friendly name. This is helpful when serializing a
TypeAnnotation to be able to tag it with a more friendly name that the full qualifier name of the class.Copyright © 2024 MuleSoft, Inc.. All rights reserved.