Class MeasureTypeSerializer
java.lang.Object
com.fasterxml.jackson.databind.JsonSerializer<MeasureType>
dev.jcputney.elearning.parser.input.scorm2004.ims.ss.types.MeasureTypeSerializer
- All Implemented Interfaces:
com.fasterxml.jackson.databind.jsonFormatVisitors.JsonFormatVisitable
public class MeasureTypeSerializer
extends com.fasterxml.jackson.databind.JsonSerializer<MeasureType>
A custom serializer for the
MeasureType class, enabling its conversion to a JSON string
representation during serialization.
This serializer ensures that the MeasureType object is serialized as the string
representation of its value, while handling null values gracefully.
The intended use is to handle serialization of measure values represented as decimals between -1 and 1 within a JSON structure.
-
Nested Class Summary
Nested classes/interfaces inherited from class com.fasterxml.jackson.databind.JsonSerializer
com.fasterxml.jackson.databind.JsonSerializer.None -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidserialize(MeasureType value, com.fasterxml.jackson.core.JsonGenerator gen, com.fasterxml.jackson.databind.SerializerProvider serializers) Serializes aMeasureTypeobject into its JSON string representation.Methods inherited from class com.fasterxml.jackson.databind.JsonSerializer
acceptJsonFormatVisitor, getDelegatee, handledType, isEmpty, isEmpty, isUnwrappingSerializer, properties, replaceDelegatee, serializeWithType, unwrappingSerializer, usesObjectId, withFilterId, withIgnoredProperties
-
Constructor Details
-
MeasureTypeSerializer
public MeasureTypeSerializer()
-
-
Method Details
-
serialize
public void serialize(MeasureType value, com.fasterxml.jackson.core.JsonGenerator gen, com.fasterxml.jackson.databind.SerializerProvider serializers) throws IOException Serializes aMeasureTypeobject into its JSON string representation. Writes the value as a string if it is non-null; otherwise, writes a JSON null.- Specified by:
serializein classcom.fasterxml.jackson.databind.JsonSerializer<MeasureType>- Parameters:
value- theMeasureTypeobject to serialize; may be nullgen- theJsonGeneratorused to generate the JSON outputserializers- theSerializerProviderthat can provide serializers for serializing objects- Throws:
IOException- if an error occurs during JSON serialization
-