Class YearSerializer
java.lang.Object
tools.jackson.databind.ValueSerializer<Year>
tools.jackson.databind.ser.std.StdSerializer<Year>
tools.jackson.databind.ext.javatime.ser.JSR310SerializerBase<Year>
tools.jackson.databind.ext.javatime.ser.JSR310FormattedSerializerBase<Year>
tools.jackson.databind.ext.javatime.ser.YearSerializer
- All Implemented Interfaces:
JsonFormatVisitable
Serializer for Java 8 temporal
Years.-
Nested Class Summary
Nested classes/interfaces inherited from class ValueSerializer
ValueSerializer.None -
Field Summary
FieldsFields inherited from class JSR310FormattedSerializerBase
_formatter, _integerListType, _shape, _useNanoseconds, _useTimestampFields inherited from class StdSerializer
_handledType -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedYearSerializer(DateTimeFormatter formatter) protectedYearSerializer(YearSerializer base, DateTimeFormatter dtf, Boolean useTimestamp) -
Method Summary
Modifier and TypeMethodDescriptionprotected void_acceptTimestampVisitor(JsonFormatVisitorWrapper visitor, JavaType typeHint) protected tools.jackson.core.JsonTokenOverridable helper method used fromJSR310SerializerBase.serializeWithType(T, JsonGenerator, SerializationContext, TypeSerializer), to indicate shape of value during serialization; needed to know how type id is to be serialized.voidserialize(Year year, tools.jackson.core.JsonGenerator generator, SerializationContext ctxt) Method that can be called to ask implementation to serialize values of type this serializer handles.protected booleanprotected YearSerializerwithFormat(DateTimeFormatter dtf, Boolean useTimestamp, com.fasterxml.jackson.annotation.JsonFormat.Shape shape) Methods inherited from class JSR310FormattedSerializerBase
_integerListType, _useDateTimeFormatter, _useTimestampExplicitOnly, acceptJsonFormatVisitor, createContextual, getTimestampsFeature, useNanoseconds, useTimestamp, withFeaturesMethods inherited from class JSR310SerializerBase
serializeWithTypeMethods inherited from class StdSerializer
_neitherNull, _nonEmpty, _wrapIOFailure, acceptJsonFormatVisitorForBinary, createSchemaNode, createSchemaNode, findAnnotatedContentSerializer, findContextualConvertingSerializer, findFormatFeature, findFormatOverrides, findIncludeOverrides, findPropertyFilter, handledType, isDefaultSerializer, visitArrayFormat, visitArrayFormat, visitFloatFormat, visitIntFormat, visitIntFormat, visitStringFormat, visitStringFormat, wrapAndThrow, wrapAndThrowMethods inherited from class ValueSerializer
getDelegatee, isEmpty, isUnwrappingSerializer, properties, replaceDelegatee, resolve, unwrappingSerializer, usesObjectId, withFilterId, withFormatOverrides, withIgnoredProperties
-
Field Details
-
INSTANCE
-
-
Constructor Details
-
YearSerializer
protected YearSerializer() -
YearSerializer
-
YearSerializer
-
-
Method Details
-
withFormat
protected YearSerializer withFormat(DateTimeFormatter dtf, Boolean useTimestamp, com.fasterxml.jackson.annotation.JsonFormat.Shape shape) - Specified by:
withFormatin classJSR310FormattedSerializerBase<Year>
-
useTimestampFromGlobalDefaults
- Overrides:
useTimestampFromGlobalDefaultsin classJSR310FormattedSerializerBase<Year>
-
serialize
public void serialize(Year year, tools.jackson.core.JsonGenerator generator, SerializationContext ctxt) throws tools.jackson.core.JacksonException Description copied from class:ValueSerializerMethod that can be called to ask implementation to serialize values of type this serializer handles.- Specified by:
serializein classStdSerializer<Year>- Parameters:
year- Value to serialize; can not be null.generator- Generator used to output resulting Json contentctxt- Context that can be used to get serializers for serializing Objects value contains, if any.- Throws:
tools.jackson.core.JacksonException
-
_acceptTimestampVisitor
- Overrides:
_acceptTimestampVisitorin classJSR310FormattedSerializerBase<Year>
-
serializationShape
Description copied from class:JSR310SerializerBaseOverridable helper method used fromJSR310SerializerBase.serializeWithType(T, JsonGenerator, SerializationContext, TypeSerializer), to indicate shape of value during serialization; needed to know how type id is to be serialized.- Specified by:
serializationShapein classJSR310SerializerBase<Year>
-