Class MetadataSerializer

  • All Implemented Interfaces:
    com.fasterxml.jackson.databind.jsonFormatVisitors.JsonFormatVisitable, com.fasterxml.jackson.databind.jsonschema.SchemaAware, Serializable

    public class MetadataSerializer
    extends com.fasterxml.jackson.databind.ser.std.StdSerializer<Metadata>

    MetadataSerializer class. Implements a custom, partially delegating serializer for Metadata objects based on Jackson CSV.

    Author:
    nilshoffmann
    See Also:
    Serialized Form
    • 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
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void serialize​(Metadata t, com.fasterxml.jackson.core.JsonGenerator jg, com.fasterxml.jackson.databind.SerializerProvider sp)
      static <T> void serializeList​(List<T> list, com.fasterxml.jackson.core.JsonGenerator jg, com.fasterxml.jackson.databind.SerializerProvider sp, Comparator<? super T> comparator)
      serializeList.
      static <T extends IndexedElement>
      void
      serializeListWithMetadataElement​(List<T> list, MetadataElement mtdElement, com.fasterxml.jackson.core.JsonGenerator jg, com.fasterxml.jackson.databind.SerializerProvider sp, Comparator<? super T> comparator)
      Serialize a list of Parameters for the provided metadata element.
      static void serializeObject​(Object object, com.fasterxml.jackson.core.JsonGenerator jg, com.fasterxml.jackson.databind.SerializerProvider sp)
      serializeObject.
      • 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
    • Method Detail

      • serializeListWithMetadataElement

        public static <T extends IndexedElement> void serializeListWithMetadataElement​(List<T> list,
                                                                                       MetadataElement mtdElement,
                                                                                       com.fasterxml.jackson.core.JsonGenerator jg,
                                                                                       com.fasterxml.jackson.databind.SerializerProvider sp,
                                                                                       Comparator<? super T> comparator)

        Serialize a list of Parameters for the provided metadata element.

        Type Parameters:
        T - a T object.
        Parameters:
        list - a List object.
        mtdElement - a MetadataElement object.
        jg - a JsonGenerator object.
        sp - a SerializerProvider object.
        comparator - a Comparator object.
      • serializeList

        public static <T> void serializeList​(List<T> list,
                                             com.fasterxml.jackson.core.JsonGenerator jg,
                                             com.fasterxml.jackson.databind.SerializerProvider sp,
                                             Comparator<? super T> comparator)

        serializeList.

        Type Parameters:
        T - a T object.
        Parameters:
        list - a List object.
        jg - a JsonGenerator object.
        sp - a SerializerProvider object.
        comparator - a Comparator object.
      • serializeObject

        public static void serializeObject​(Object object,
                                           com.fasterxml.jackson.core.JsonGenerator jg,
                                           com.fasterxml.jackson.databind.SerializerProvider sp)

        serializeObject.

        Parameters:
        object - a Object object.
        jg - a JsonGenerator object.
        sp - a SerializerProvider object.
      • serialize

        public void serialize​(Metadata t,
                              com.fasterxml.jackson.core.JsonGenerator jg,
                              com.fasterxml.jackson.databind.SerializerProvider sp)
                       throws IOException
        Specified by:
        serialize in class com.fasterxml.jackson.databind.ser.std.StdSerializer<Metadata>
        Throws:
        IOException