Package gov.nasa.jpl.aerie.json
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 -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidserialize(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
-
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:
serializein classcom.fasterxml.jackson.databind.JsonSerializer<FormattedError>- Throws:
IOException
-