Class FormattedError.FormattedErrorSerializer

java.lang.Object
com.fasterxml.jackson.databind.JsonSerializer<FormattedError>
gov.nasa.jpl.aerie.json.FormattedError.FormattedErrorSerializer
All Implemented Interfaces:
com.fasterxml.jackson.databind.jsonFormatVisitors.JsonFormatVisitable
Enclosing class:
FormattedError

public static final class FormattedError.FormattedErrorSerializer extends com.fasterxml.jackson.databind.JsonSerializer<FormattedError>
Internal class so that Javalin serializes the FormattedError class using its `toJson` method. This avoids needing to call `toJson` every time the FormattedError class is used as an endpoint return. The class implements Jackson's JsonSerializer in specific because Javalin uses Jackson as its default JSON Mapper.
  • Nested Class Summary

    Nested classes/interfaces inherited from class com.fasterxml.jackson.databind.JsonSerializer

    com.fasterxml.jackson.databind.JsonSerializer.None
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static boolean
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    serialize(FormattedError formattedError, com.fasterxml.jackson.core.JsonGenerator jsonGenerator, com.fasterxml.jackson.databind.SerializerProvider serializerProvider)
     

    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
  • Field Details

    • USE_HASURA_FORMATTING

      public static boolean USE_HASURA_FORMATTING
  • Constructor Details

    • FormattedErrorSerializer

      public FormattedErrorSerializer()
  • Method Details

    • serialize

      public void serialize(FormattedError formattedError, com.fasterxml.jackson.core.JsonGenerator jsonGenerator, com.fasterxml.jackson.databind.SerializerProvider serializerProvider) throws IOException
      Specified by:
      serialize in class com.fasterxml.jackson.databind.JsonSerializer<FormattedError>
      Throws:
      IOException