com.fasterxml.jackson.databind.ser.std

## Class CalendarSerializer

- java.lang.Object
- - com.fasterxml.jackson.databind.JsonSerializer<T>
  - - com.fasterxml.jackson.databind.ser.std.StdSerializer<T>
    - - com.fasterxml.jackson.databind.ser.std.StdScalarSerializer<T>
      - - com.fasterxml.jackson.databind.ser.std.DateTimeSerializerBase<java.util.Calendar>
        - - com.fasterxml.jackson.databind.ser.std.CalendarSerializer

- All Implemented Interfaces:
    JsonFormatVisitable, SchemaAware, ContextualSerializer, java.io.Serializable

      public class CalendarSerializer
      extends DateTimeSerializerBase<java.util.Calendar>

  Standard serializer for `Calendar`. As with other time/date types, is configurable to produce timestamps (standard Java 64-bit timestamp) or textual formats (usually ISO-8601).
  See Also:
    Serialized Form

- - ### Nested Class Summary

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

      `JsonSerializer.None`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static CalendarSerializer` | `instance`

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

      `_customFormat, _useTimestamp`

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

      `_handledType`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `CalendarSerializer()`
    `CalendarSerializer(java.lang.Boolean useTimestamp, java.text.DateFormat customFormat)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected long` | `_timestamp(java.util.Calendar value)`
    `void` | `serialize(java.util.Calendar value, com.fasterxml.jackson.core.JsonGenerator jgen, SerializerProvider provider)` Method that can be called to ask implementation to serialize values of type this serializer handles.
    `CalendarSerializer` | `withFormat(java.lang.Boolean timestamp, java.text.DateFormat customFormat)`

    - ### Methods inherited from class com.fasterxml.jackson.databind.ser.std.DateTimeSerializerBase

      `_acceptJsonFormatVisitor, _asTimestamp, acceptJsonFormatVisitor, createContextual, getSchema, isEmpty, isEmpty`

    - ### Methods inherited from class com.fasterxml.jackson.databind.ser.std.StdScalarSerializer

      `serializeWithType`

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

      `createObjectNode, createSchemaNode, createSchemaNode, findAnnotatedContentSerializer, findConvertingContentSerializer, findFormatFeature, findFormatOverrides, findIncludeOverrides, findPropertyFilter, getSchema, handledType, isDefaultSerializer, visitArrayFormat, visitArrayFormat, visitFloatFormat, visitIntFormat, visitIntFormat, visitStringFormat, visitStringFormat, wrapAndThrow, wrapAndThrow`

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

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

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

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

- - ### Field Detail

    - #### instance

          public static final CalendarSerializer instance

  - ### Constructor Detail

    - #### CalendarSerializer

          public CalendarSerializer()

    - #### CalendarSerializer

          public CalendarSerializer(java.lang.Boolean useTimestamp,
                            java.text.DateFormat customFormat)

  - ### Method Detail

    - #### withFormat

          public CalendarSerializer withFormat(java.lang.Boolean timestamp,
                                      java.text.DateFormat customFormat)

      Specified by:
        `withFormat` in class `DateTimeSerializerBase<java.util.Calendar>`

    - #### _timestamp

          protected long _timestamp(java.util.Calendar value)

      Specified by:
        `_timestamp` in class `DateTimeSerializerBase<java.util.Calendar>`

    - #### serialize

          public void serialize(java.util.Calendar value,
                       com.fasterxml.jackson.core.JsonGenerator jgen,
                       SerializerProvider provider)
                         throws java.io.IOException

      Description copied from class: `JsonSerializer`
      Method that can be called to ask implementation to serialize values of type this serializer handles.
      Specified by:
        `serialize` in class `DateTimeSerializerBase<java.util.Calendar>`
      Parameters:
        `value` - Value to serialize; can not be null.
        `jgen` - Generator used to output resulting Json content
        `provider` - Provider that can be used to get serializers for serializing Objects value contains, if any.
      Throws:
        `java.io.IOException`