Package dev.orne.i18n

Class I18nStringJacksonSerializer

java.lang.Object
com.fasterxml.jackson.databind.JsonSerializer<T>
com.fasterxml.jackson.databind.ser.std.StdSerializer<I18nString>
dev.orne.i18n.I18nStringJacksonSerializer
All Implemented Interfaces:
com.fasterxml.jackson.databind.jsonFormatVisitors.JsonFormatVisitable, com.fasterxml.jackson.databind.jsonschema.SchemaAware, com.fasterxml.jackson.databind.ser.ContextualSerializer, Serializable

@API(status=INTERNAL, since="0.1") public class I18nStringJacksonSerializer extends com.fasterxml.jackson.databind.ser.std.StdSerializer<I18nString> implements com.fasterxml.jackson.databind.ser.ContextualSerializer
Jackson JSON serializer for I18nString instances.
Since:
0.1
Version:
1.0, 2021-02
Author:
(w) Iker Hernaez
See Also:
  • Nested Class Summary

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

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

    Fields inherited from class com.fasterxml.jackson.databind.ser.std.StdSerializer

    _handledType
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
     
    Creates a new instance that serializes all instances as current language translation text.
    protected
    I18nStringJacksonSerializer(boolean mapsAsObject)
    Creates a new instance.
  • Method Summary

    Modifier and Type
    Method
    Description
    com.fasterxml.jackson.databind.JsonSerializer<?>
    createContextual(@NotNull com.fasterxml.jackson.databind.SerializerProvider provider, @NotNull com.fasterxml.jackson.databind.BeanProperty property)
    void
    serialize(@NotNull I18nString value, @NotNull com.fasterxml.jackson.core.JsonGenerator jgen, @NotNull com.fasterxml.jackson.databind.SerializerProvider provider)

    Methods inherited from class com.fasterxml.jackson.databind.ser.std.StdSerializer

    _neitherNull, _nonEmpty, acceptJsonFormatVisitor, createSchemaNode, createSchemaNode, findAnnotatedContentSerializer, findContextualConvertingSerializer, findConvertingContentSerializer, findFormatFeature, findFormatOverrides, findIncludeOverrides, findPropertyFilter, getSchema, getSchema, handledType, isDefaultSerializer, visitArrayFormat, visitArrayFormat, visitFloatFormat, visitIntFormat, visitIntFormat, visitStringFormat, visitStringFormat, wrapAndThrow, wrapAndThrow

    Methods inherited from class com.fasterxml.jackson.databind.JsonSerializer

    getDelegatee, isEmpty, isEmpty, isUnwrappingSerializer, properties, replaceDelegatee, serializeWithType, unwrappingSerializer, usesObjectId, withFilterId

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • I18nStringJacksonSerializer

      public I18nStringJacksonSerializer()
      Creates a new instance that serializes all instances as current language translation text.
    • I18nStringJacksonSerializer

      protected I18nStringJacksonSerializer(boolean mapsAsObject)
      Creates a new instance.
      Parameters:
      mapsAsObject - If I18nStringMap instances should be serialized as objects
  • Method Details

    • createContextual

      public com.fasterxml.jackson.databind.JsonSerializer<?> createContextual(@NotNull @NotNull com.fasterxml.jackson.databind.SerializerProvider provider, @NotNull @NotNull com.fasterxml.jackson.databind.BeanProperty property) throws com.fasterxml.jackson.databind.JsonMappingException
      Specified by:
      createContextual in interface com.fasterxml.jackson.databind.ser.ContextualSerializer
      Throws:
      com.fasterxml.jackson.databind.JsonMappingException
    • serialize

      public void serialize(@NotNull @NotNull I18nString value, @NotNull @NotNull com.fasterxml.jackson.core.JsonGenerator jgen, @NotNull @NotNull com.fasterxml.jackson.databind.SerializerProvider provider) throws IOException
      Specified by:
      serialize in class com.fasterxml.jackson.databind.ser.std.StdSerializer<I18nString>
      Throws:
      IOException