Class MonthDaySerializer
- java.lang.Object
-
- com.fasterxml.jackson.databind.JsonSerializer<T>
-
- com.fasterxml.jackson.databind.ser.std.StdSerializer<T>
-
- com.fasterxml.jackson.datatype.jsr310.ser.JSR310SerializerBase<T>
-
- com.fasterxml.jackson.datatype.jsr310.ser.JSR310FormattedSerializerBase<java.time.MonthDay>
-
- com.fasterxml.jackson.datatype.jsr310.ser.MonthDaySerializer
-
- All Implemented Interfaces:
com.fasterxml.jackson.databind.jsonFormatVisitors.JsonFormatVisitable
,com.fasterxml.jackson.databind.jsonschema.SchemaAware
,com.fasterxml.jackson.databind.ser.ContextualSerializer
,java.io.Serializable
public class MonthDaySerializer extends JSR310FormattedSerializerBase<java.time.MonthDay>
Serializer for Java 8 temporalMonthDay
s.NOTE: unlike many other date/time type serializers, this serializer will only use Array notation if explicitly instructed to do so with
JsonFormat
(either directly or through per-type defaults) and NOT with global defaults.- Since:
- 2.7.1
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static MonthDaySerializer
INSTANCE
private static long
serialVersionUID
-
Fields inherited from class com.fasterxml.jackson.datatype.jsr310.ser.JSR310FormattedSerializerBase
_formatter, _integerListType, _shape, _useNanoseconds, _useTimestamp
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
MonthDaySerializer()
private
MonthDaySerializer(MonthDaySerializer base, java.lang.Boolean useTimestamp, java.time.format.DateTimeFormatter formatter)
MonthDaySerializer(java.time.format.DateTimeFormatter formatter)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
_serializeAsArrayContents(java.time.MonthDay value, com.fasterxml.jackson.core.JsonGenerator g, com.fasterxml.jackson.databind.SerializerProvider provider)
protected com.fasterxml.jackson.core.JsonToken
serializationShape(com.fasterxml.jackson.databind.SerializerProvider provider)
Overridable helper method used fromJSR310SerializerBase.serializeWithType(T, com.fasterxml.jackson.core.JsonGenerator, com.fasterxml.jackson.databind.SerializerProvider, com.fasterxml.jackson.databind.jsontype.TypeSerializer)
, to indicate shape of value during serialization; needed to know how type id is to be serialized.void
serialize(java.time.MonthDay value, com.fasterxml.jackson.core.JsonGenerator g, com.fasterxml.jackson.databind.SerializerProvider provider)
void
serializeWithType(java.time.MonthDay value, com.fasterxml.jackson.core.JsonGenerator g, com.fasterxml.jackson.databind.SerializerProvider provider, com.fasterxml.jackson.databind.jsontype.TypeSerializer typeSer)
protected MonthDaySerializer
withFormat(java.lang.Boolean useTimestamp, java.time.format.DateTimeFormatter formatter, com.fasterxml.jackson.annotation.JsonFormat.Shape shape)
-
Methods inherited from class com.fasterxml.jackson.datatype.jsr310.ser.JSR310FormattedSerializerBase
_acceptTimestampVisitor, _integerListType, _useDateTimeFormatter, _useTimestampExplicitOnly, acceptJsonFormatVisitor, createContextual, getSchema, getTimestampsFeature, useNanoseconds, useTimestamp, withFeatures, withFeatures
-
Methods inherited from class com.fasterxml.jackson.databind.ser.std.StdSerializer
_neitherNull, _nonEmpty, createSchemaNode, createSchemaNode, findAnnotatedContentSerializer, findContextualConvertingSerializer, findConvertingContentSerializer, findFormatFeature, findFormatOverrides, findIncludeOverrides, findPropertyFilter, getSchema, handledType, isDefaultSerializer, visitArrayFormat, visitArrayFormat, visitFloatFormat, visitIntFormat, visitIntFormat, visitStringFormat, visitStringFormat, wrapAndThrow, wrapAndThrow
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
INSTANCE
public static final MonthDaySerializer INSTANCE
-
-
Constructor Detail
-
MonthDaySerializer
protected MonthDaySerializer()
-
MonthDaySerializer
public MonthDaySerializer(java.time.format.DateTimeFormatter formatter)
-
MonthDaySerializer
private MonthDaySerializer(MonthDaySerializer base, java.lang.Boolean useTimestamp, java.time.format.DateTimeFormatter formatter)
-
-
Method Detail
-
withFormat
protected MonthDaySerializer withFormat(java.lang.Boolean useTimestamp, java.time.format.DateTimeFormatter formatter, com.fasterxml.jackson.annotation.JsonFormat.Shape shape)
- Specified by:
withFormat
in classJSR310FormattedSerializerBase<java.time.MonthDay>
-
serialize
public void serialize(java.time.MonthDay value, com.fasterxml.jackson.core.JsonGenerator g, com.fasterxml.jackson.databind.SerializerProvider provider) throws java.io.IOException
- Specified by:
serialize
in classcom.fasterxml.jackson.databind.ser.std.StdSerializer<java.time.MonthDay>
- Throws:
java.io.IOException
-
serializeWithType
public void serializeWithType(java.time.MonthDay value, com.fasterxml.jackson.core.JsonGenerator g, com.fasterxml.jackson.databind.SerializerProvider provider, com.fasterxml.jackson.databind.jsontype.TypeSerializer typeSer) throws java.io.IOException
- Overrides:
serializeWithType
in classJSR310SerializerBase<java.time.MonthDay>
- Throws:
java.io.IOException
-
_serializeAsArrayContents
protected void _serializeAsArrayContents(java.time.MonthDay value, com.fasterxml.jackson.core.JsonGenerator g, com.fasterxml.jackson.databind.SerializerProvider provider) throws java.io.IOException
- Throws:
java.io.IOException
-
serializationShape
protected com.fasterxml.jackson.core.JsonToken serializationShape(com.fasterxml.jackson.databind.SerializerProvider provider)
Description copied from class:JSR310SerializerBase
Overridable helper method used fromJSR310SerializerBase.serializeWithType(T, com.fasterxml.jackson.core.JsonGenerator, com.fasterxml.jackson.databind.SerializerProvider, com.fasterxml.jackson.databind.jsontype.TypeSerializer)
, to indicate shape of value during serialization; needed to know how type id is to be serialized.- Specified by:
serializationShape
in classJSR310SerializerBase<java.time.MonthDay>
-
-