Package com.fasterxml.jackson.datatype.joda.ser

## Class PeriodSerializer

- java.lang.Object
- - com.fasterxml.jackson.databind.JsonSerializer<T>
  - - com.fasterxml.jackson.databind.ser.std.StdSerializer<T>
    - - com.fasterxml.jackson.datatype.joda.ser.PeriodSerializer

All Implemented Interfaces:
  `com.fasterxml.jackson.databind.ser.ContextualSerializer`, `Serializable`

    public class PeriodSerializer
    extends com.fasterxml.jackson.databind.ser.std.StdSerializer<T>
    implements com.fasterxml.jackson.databind.ser.ContextualSerializer

Serializes a `ReadablePeriod` using Joda default formatting.

TODO: allow serialization as an array of numbers, for numeric ("timestamp") notation?

See Also:
  Serialized Form

### Nested Class Summary

### Nested classes/interfaces inherited from class com.fasterxml.jackson.databind.JsonSerializer

`com.fasterxml.jackson.databind.JsonSerializer.None`

### Field Summary

Fields
`protected JacksonJodaPeriodFormat` `_format`

### Fields inherited from class com.fasterxml.jackson.databind.ser.std.StdSerializer

`_handledType`

### Constructor Summary

Constructors
`` `PeriodSerializer​()`
`protected` `PeriodSerializer​(JacksonJodaPeriodFormat format)`

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `acceptJsonFormatVisitor​(com.fasterxml.jackson.databind.jsonFormatVisitors.JsonFormatVisitorWrapper visitor, com.fasterxml.jackson.databind.JavaType typeHint)`
`com.fasterxml.jackson.databind.JsonSerializer<?>` `createContextual​(com.fasterxml.jackson.databind.SerializerProvider prov, com.fasterxml.jackson.databind.BeanProperty property)`
`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 gen, com.fasterxml.jackson.databind.SerializerProvider provider)`
`void` `serializeWithType​(T value, com.fasterxml.jackson.core.JsonGenerator g, com.fasterxml.jackson.databind.SerializerProvider provider, com.fasterxml.jackson.databind.jsontype.TypeSerializer typeSer)`

### Methods inherited from class com.fasterxml.jackson.databind.JsonSerializer

`getDelegatee, isEmpty, isEmpty, isUnwrappingSerializer, properties, replaceDelegatee, unwrappingSerializer, usesObjectId, withFilterId`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### 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

#### _format

    protected final JacksonJodaPeriodFormat _format

### Constructor Detail

#### PeriodSerializer

    public PeriodSerializer​()

#### PeriodSerializer

    protected PeriodSerializer​(JacksonJodaPeriodFormat format)

### Method Detail

#### createContextual

    public com.fasterxml.jackson.databind.JsonSerializer<?> createContextual​(com.fasterxml.jackson.databind.SerializerProvider prov,
                                                                             com.fasterxml.jackson.databind.BeanProperty property)
                                                                      throws com.fasterxml.jackson.databind.JsonMappingException

Specified by:
  `createContextual` in interface `com.fasterxml.jackson.databind.ser.ContextualSerializer`
Throws:
  `com.fasterxml.jackson.databind.JsonMappingException`

#### serialize

    public void serialize​(org.joda.time.ReadablePeriod value,
                          com.fasterxml.jackson.core.JsonGenerator gen,
                          com.fasterxml.jackson.databind.SerializerProvider provider)
                   throws IOException

Specified by:
  `serialize` in class `com.fasterxml.jackson.databind.ser.std.StdSerializer<org.joda.time.ReadablePeriod>`
Throws:
  `IOException`

#### getSchema

    public com.fasterxml.jackson.databind.JsonNode getSchema​(com.fasterxml.jackson.databind.SerializerProvider provider,
                                                             Type typeHint)

Overrides:
  `getSchema` in class `com.fasterxml.jackson.databind.ser.std.StdSerializer<org.joda.time.ReadablePeriod>`

#### acceptJsonFormatVisitor

    public void acceptJsonFormatVisitor​(com.fasterxml.jackson.databind.jsonFormatVisitors.JsonFormatVisitorWrapper visitor,
                                        com.fasterxml.jackson.databind.JavaType typeHint)
                                 throws com.fasterxml.jackson.databind.JsonMappingException

Overrides:
  `acceptJsonFormatVisitor` in class `com.fasterxml.jackson.databind.ser.std.StdSerializer<org.joda.time.ReadablePeriod>`
Throws:
  `com.fasterxml.jackson.databind.JsonMappingException`

#### serializeWithType

    public void serializeWithType​(T value,
                                  com.fasterxml.jackson.core.JsonGenerator g,
                                  com.fasterxml.jackson.databind.SerializerProvider provider,
                                  com.fasterxml.jackson.databind.jsontype.TypeSerializer typeSer)
                           throws IOException

Overrides:
  `serializeWithType` in class `com.fasterxml.jackson.databind.JsonSerializer<T>`
Throws:
  `IOException`