Package de.isas.mztab2.io.serialization
Class MetadataSerializer
- java.lang.Object
-
- com.fasterxml.jackson.databind.JsonSerializer<T>
-
- com.fasterxml.jackson.databind.ser.std.StdSerializer<Metadata>
-
- de.isas.mztab2.io.serialization.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
-
-
Constructor Summary
Constructors Constructor Description MetadataSerializer()
Constructor for MetadataSerializer.MetadataSerializer(Class<Metadata> t)
Constructor for MetadataSerializer.
-
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>
voidserializeListWithMetadataElement(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
-
-
-
-
Constructor Detail
-
MetadataSerializer
public MetadataSerializer()
Constructor for MetadataSerializer.
-
MetadataSerializer
public MetadataSerializer(Class<Metadata> t)
Constructor for MetadataSerializer.
- Parameters:
t
- aClass
object.
-
-
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
- aList
object.mtdElement
- aMetadataElement
object.jg
- aJsonGenerator
object.sp
- aSerializerProvider
object.comparator
- aComparator
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
- aList
object.jg
- aJsonGenerator
object.sp
- aSerializerProvider
object.comparator
- aComparator
object.
-
serializeObject
public static void serializeObject(Object object, com.fasterxml.jackson.core.JsonGenerator jg, com.fasterxml.jackson.databind.SerializerProvider sp)
serializeObject.
- Parameters:
object
- aObject
object.jg
- aJsonGenerator
object.sp
- aSerializerProvider
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 classcom.fasterxml.jackson.databind.ser.std.StdSerializer<Metadata>
- Throws:
IOException
-
-