public final class PeriodSerializer
extends com.fasterxml.jackson.databind.ser.std.StdSerializer<T>
ReadablePeriod using Joda default formatting.
TODO: allow serialization as an array of numbers, for numeric ("timestamp") notation?
| Modifier and Type | Field and Description |
|---|---|
protected org.joda.time.format.PeriodFormatter |
defaultFormat |
| Constructor and Description |
|---|
PeriodSerializer() |
| Modifier and Type | Method and Description |
|---|---|
com.fasterxml.jackson.databind.JsonNode |
getSchema(com.fasterxml.jackson.databind.SerializerProvider provider,
Type typeHint) |
void |
serialize(org.joda.time.ReadablePeriod value,
com.fasterxml.jackson.core.JsonGenerator jgen,
com.fasterxml.jackson.databind.SerializerProvider provider) |
void |
serializeWithType(T value,
com.fasterxml.jackson.core.JsonGenerator jgen,
com.fasterxml.jackson.databind.SerializerProvider provider,
com.fasterxml.jackson.databind.jsontype.TypeSerializer typeSer) |
acceptJsonFormatVisitor, createObjectNode, createSchemaNode, createSchemaNode, findConvertingContentSerializer, findPropertyFilter, getSchema, handledType, isDefaultSerializer, wrapAndThrow, wrapAndThrowpublic void serialize(org.joda.time.ReadablePeriod value,
com.fasterxml.jackson.core.JsonGenerator jgen,
com.fasterxml.jackson.databind.SerializerProvider provider)
throws IOException,
com.fasterxml.jackson.core.JsonProcessingException
serialize in class com.fasterxml.jackson.databind.ser.std.StdSerializer<org.joda.time.ReadablePeriod>IOExceptioncom.fasterxml.jackson.core.JsonProcessingExceptionpublic com.fasterxml.jackson.databind.JsonNode getSchema(com.fasterxml.jackson.databind.SerializerProvider provider,
Type typeHint)
getSchema in interface com.fasterxml.jackson.databind.jsonschema.SchemaAwaregetSchema in class com.fasterxml.jackson.databind.ser.std.StdSerializer<org.joda.time.ReadablePeriod>public void serializeWithType(T value,
com.fasterxml.jackson.core.JsonGenerator jgen,
com.fasterxml.jackson.databind.SerializerProvider provider,
com.fasterxml.jackson.databind.jsontype.TypeSerializer typeSer)
throws IOException,
com.fasterxml.jackson.core.JsonProcessingException
serializeWithType in class com.fasterxml.jackson.databind.JsonSerializer<T>IOExceptioncom.fasterxml.jackson.core.JsonProcessingExceptionCopyright © 2015. All rights reserved.