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
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    serialize(MeasureType value, com.fasterxml.jackson.core.JsonGenerator gen, com.fasterxml.jackson.databind.SerializerProvider serializers)
    Serializes a MeasureType object 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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 a MeasureType object into its JSON string representation. Writes the value as a string if it is non-null; otherwise, writes a JSON null.
      Specified by:
      serialize in class com.fasterxml.jackson.databind.JsonSerializer<MeasureType>
      Parameters:
      value - the MeasureType object to serialize; may be null
      gen - the JsonGenerator used to generate the JSON output
      serializers - the SerializerProvider that can provide serializers for serializing objects
      Throws:
      IOException - if an error occurs during JSON serialization