Top Description Fields Constructors Methods
com.fasterxml.jackson.datatype.joda.ser

public Class DurationSerializer

extends JodaDateSerializerBase<Duration>
Class Inheritance
Imports
java.io.IOException, org.joda.time.Duration, com.fasterxml.jackson.core.JsonGenerator, com.fasterxml.jackson.databind.SerializationFeature, .SerializerProvider, com.fasterxml.jackson.datatype.joda.cfg.FormatConfig, .JacksonJodaDateFormat

References Deprecated

JodaDateSerializerBase is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

Serializes a Duration; either as number of millis, or, if textual output requested, using ISO-8601 format.

Field Summary

Modifier and TypeField and Description
private static final long
Inherited from com.fasterxml.jackson.datatype.joda.ser.JodaDateSerializerBase:
_defaultNumericShape_featureForNumeric_format_shapeOverrideFORMAT_ARRAYFORMAT_STRINGFORMAT_TIMESTAMP

Constructor Summary

AccessConstructor and Description
public
public
public
DurationSerializer(JacksonJodaDateFormat formatter, int shapeOverride)

Method Summary

Modifier and TypeMethod and Description
public boolean
isEmpty(SerializerProvider prov, Duration value)

Overrides com.fasterxml.jackson.datatype.joda.ser.JodaDateSerializerBase.isEmpty.

Method called to check whether given serializable value is considered "empty" value (for purposes of suppressing serialization of empty values).

public void
serialize(Duration
Value to serialize; can not be null.
value
,
JsonGenerator
Generator used to output resulting Json content
gen
,
SerializerProvider
Provider that can be used to get serializers for serializing Objects value contains, if any.
provider
)

Implements abstract com.fasterxml.jackson.databind.ser.std.StdSerializer.serialize.

Method that can be called to ask implementation to serialize values of type this serializer handles.

public DurationSerializer
withFormat(JacksonJodaDateFormat formatter, int shapeOverride)

Implements abstract com.fasterxml.jackson.datatype.joda.ser.JodaDateSerializerBase.withFormat.

References Deprecated DurationSerializer is deprecated or references (maybe indirectly) at least one deprecated element.

Inherited from com.fasterxml.jackson.datatype.joda.ser.JodaDateSerializerBase:
_serializationShapeacceptJsonFormatVisitorcreateContextualgetSchemawriteWithZoneId

Field Detail

serialVersionUIDback to summary
private static final long serialVersionUID

Hides com.fasterxml.jackson.datatype.joda.ser.JodaDateSerializerBase.serialVersionUID.

Constructor Detail

DurationSerializerback to summary
public DurationSerializer()
DurationSerializerback to summary
public DurationSerializer(JacksonJodaDateFormat format)
DurationSerializerback to summary
public DurationSerializer(JacksonJodaDateFormat formatter, int shapeOverride)

Method Detail

isEmptyback to summary
public boolean isEmpty(SerializerProvider prov, Duration value)

Overrides com.fasterxml.jackson.datatype.joda.ser.JodaDateSerializerBase.isEmpty.

Doc from com.fasterxml.jackson.databind.JsonSerializer.isEmpty.

Method called to check whether given serializable value is considered "empty" value (for purposes of suppressing serialization of empty values).

Default implementation will consider only null values to be empty.

Note

replaces isEmpty(Object), which was deprecated in 2.5

Annotations
@Override
serializeback to summary
public void serialize(Duration value, JsonGenerator gen, SerializerProvider provider) throws IOException

Implements abstract com.fasterxml.jackson.databind.ser.std.StdSerializer.serialize.

Doc from com.fasterxml.jackson.databind.JsonSerializer.serialize.

Method that can be called to ask implementation to serialize values of type this serializer handles.

Parameters
value:Duration

Value to serialize; can not be null.

gen:JsonGenerator

Generator used to output resulting Json content

provider:SerializerProvider

Provider that can be used to get serializers for serializing Objects value contains, if any.

Annotations
@Override
withFormatback to summary
public DurationSerializer withFormat(JacksonJodaDateFormat formatter, int shapeOverride)

Implements abstract com.fasterxml.jackson.datatype.joda.ser.JodaDateSerializerBase.withFormat.

References Deprecated

DurationSerializer is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

Annotations
@Override