java.time) type handling (see
tools.jackson.databind.ext.javatime.JavaTimeInitializer )
but also to "legacy" (java.util.Date , java.util.Calendar )
and Joda Date/Time.
| Modifier and Type | Field and Description |
|---|---|
| private final boolean | _enabledByDefault
Whether feature is enabled or disabled by default. |
| private final int | |
| public static final DateTimeFeature | ADJUST_DATES_TO_CONTEXT_TIME_ZONE
Feature that specifies whether context provided |
| public static final DateTimeFeature | ALWAYS_ALLOW_STRINGIFIED_DATE_TIMESTAMPS
Feature that controls whether stringified numbers (Strings that without
quotes would be legal JSON Numbers) may be interpreted as
timestamps (enabled) or not (disabled), in case where there is an
explicitly defined pattern ( |
| private static final int | |
| public static final DateTimeFeature | NORMALIZE_DESERIALIZED_ZONE_ID
Feature that determines whether |
| public static final DateTimeFeature | ONE_BASED_MONTHS
Feature that determines whether |
| public static final DateTimeFeature | READ_DATE_TIMESTAMPS_AS_NANOSECONDS
Feature that controls whether numeric timestamp values are expected to be written using nanosecond timestamps (enabled) or not (disabled), if and only if datatype supports such resolution. |
| public static final DateTimeFeature | USE_TIME_ZONE_FOR_LENIENT_DATE_PARSING
Feature that determines whether the |
| public static final DateTimeFeature | WRITE_DATE_KEYS_AS_TIMESTAMPS
Feature that determines whether |
| public static final DateTimeFeature | WRITE_DATE_TIMESTAMPS_AS_NANOSECONDS
Feature that controls whether numeric timestamp values are to be written using nanosecond timestamps (enabled) or not (disabled); if and only if datatype supports such resolution. |
| public static final DateTimeFeature | WRITE_DATES_AS_TIMESTAMPS
Feature that determines whether Date (and date/time) values
(and Date-based things like |
| public static final DateTimeFeature | WRITE_DATES_WITH_CONTEXT_TIME_ZONE
Feature that determines whether timezone/offset included in zoned date/time
values (note: does NOT |
| public static final DateTimeFeature | WRITE_DATES_WITH_ZONE_ID
Feature that determines whether date/date-time values should be serialized so that they include timezone id, in cases where type itself contains timezone information. |
| public static final DateTimeFeature | WRITE_DURATIONS_AS_TIMESTAMPS
Feature that determines whether time values that represents time periods (durations, periods, ranges) are to be serialized by default using a numeric (true) or textual (false) representations. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | enabledByDefault()
Implements tools. Accessor for checking whether this feature is enabled by default. |
| public boolean | enabledIn(int flags)
Implements tools. Convenience method for checking whether feature is enabled in given bitmask. |
| public int | featureIndex()
Implements tools. Internal index used for efficient storage and index; no user serviceable contents inside! |
| public int | getMask()
Implements tools. Returns bit mask for this feature instance; must be a single bit,
that is of form |
| public static DateTimeFeature | |
| public static DateTimeFeature[] |
| _enabledByDefault | back to summary |
|---|---|
| private final boolean _enabledByDefault Whether feature is enabled or disabled by default. | |
| _mask | back to summary |
|---|---|
| private final int _mask | |
| ADJUST_DATES_TO_CONTEXT_TIME_ZONE | back to summary |
|---|---|
| public static final DateTimeFeature ADJUST_DATES_TO_CONTEXT_TIME_ZONE Feature that specifies whether context provided
Note that exact behavior depends on date/time types in question; and specifically
JDK type of Taking above into account, this feature is supported only by extension modules for Joda and Java 8 date/time datatypes.
Feature used to be one of | |
| ALWAYS_ALLOW_STRINGIFIED_DATE_TIMESTAMPS | back to summary |
|---|---|
| public static final DateTimeFeature ALWAYS_ALLOW_STRINGIFIED_DATE_TIMESTAMPS Feature that controls whether stringified numbers (Strings that without
quotes would be legal JSON Numbers) may be interpreted as
timestamps (enabled) or not (disabled), in case where there is an
explicitly defined pattern ( Note that when the default pattern is used (no custom pattern defined), stringified numbers are always accepted as timestamps regardless of this feature. | |
| FEATURE_INDEX | back to summary |
|---|---|
| private static final int FEATURE_INDEX | |
| NORMALIZE_DESERIALIZED_ZONE_ID | back to summary |
|---|---|
| public static final DateTimeFeature NORMALIZE_DESERIALIZED_ZONE_ID Feature that determines whether Default setting is enabled, for backwards-compatibility with Jackson 2.15. | |
| ONE_BASED_MONTHS | back to summary |
|---|---|
| public static final DateTimeFeature ONE_BASED_MONTHS Feature that determines whether
Default setting is Note default setting changed between Jackson 2.x (was | |
| READ_DATE_TIMESTAMPS_AS_NANOSECONDS | back to summary |
|---|---|
| public static final DateTimeFeature READ_DATE_TIMESTAMPS_AS_NANOSECONDS Feature that controls whether numeric timestamp values are expected to be written using nanosecond timestamps (enabled) or not (disabled), if and only if datatype supports such resolution. Only newer datatypes (such as Java8 Date/Time) support such resolution -- older types (pre-Java8 java.util.Date etc) and Joda do not -- and this setting has no effect on such types.
If disabled, standard millisecond timestamps are assumed.
This is the counterpart to
Feature used to be one of Feature is enabled by default, to support most accurate time values possible (where available). | |
| USE_TIME_ZONE_FOR_LENIENT_DATE_PARSING | back to summary |
|---|---|
| public static final DateTimeFeature USE_TIME_ZONE_FOR_LENIENT_DATE_PARSING Feature that determines whether the Default setting is disabled, for backwards-compatibility with Jackson 2.18. | |
| WRITE_DATE_KEYS_AS_TIMESTAMPS | back to summary |
|---|---|
| public static final DateTimeFeature WRITE_DATE_KEYS_AS_TIMESTAMPS Feature that determines whether
Feature used to be one of Feature is disabled by default, meaning that Date-valued Map keys are serialized as textual (ISO-8601) values. | |
| WRITE_DATE_TIMESTAMPS_AS_NANOSECONDS | back to summary |
|---|---|
| public static final DateTimeFeature WRITE_DATE_TIMESTAMPS_AS_NANOSECONDS Feature that controls whether numeric timestamp values are to be written using nanosecond timestamps (enabled) or not (disabled); if and only if datatype supports such resolution. Only newer datatypes (such as Java8 Date/Time) support such resolution -- older types (pre-Java8 java.util.Date etc) and Joda do not -- and this setting has no effect on such types.
If disabled, standard millisecond timestamps are assumed.
This is the counterpart to
Feature used to be one of Feature is enabled by default, to support most accurate time values possible. | |
| WRITE_DATES_AS_TIMESTAMPS | back to summary |
|---|---|
| public static final DateTimeFeature WRITE_DATES_AS_TIMESTAMPS Feature that determines whether Date (and date/time) values
(and Date-based things like
For "classic" JDK date types ( Note whether
Feature used to be one of Feature is disabled by default as of Jackson 3.0 (in 2.x it was enabled), so that date/time are by default serialized as textual values NOT timestamps. | |
| WRITE_DATES_WITH_CONTEXT_TIME_ZONE | back to summary |
|---|---|
| public static final DateTimeFeature WRITE_DATES_WITH_CONTEXT_TIME_ZONE Feature that determines whether timezone/offset included in zoned date/time
values (note: does NOT
Note that this setting only affects "Zoned" date/time values of
Feature used to be one of Feature is enabled by default for backwards-compatibility purposes (from Jackson 2.x) | |
| WRITE_DATES_WITH_ZONE_ID | back to summary |
|---|---|
| public static final DateTimeFeature WRITE_DATES_WITH_ZONE_ID Feature that determines whether date/date-time values should be serialized so that they include timezone id, in cases where type itself contains timezone information. Including this information may lead to compatibility issues because ISO-8601 specification does not define formats that include such information.
If enabled, Timezone id should be included using format specified
with Java 8 Note setting has no relevance if date/time values are serialized as timestamps.
Feature used to be one of Feature is disabled by default, so that zone id is NOT included; rather, timezone offset is used for ISO-8601 compatibility (if any timezone information is included in value). | |
| WRITE_DURATIONS_AS_TIMESTAMPS | back to summary |
|---|---|
| public static final DateTimeFeature WRITE_DURATIONS_AS_TIMESTAMPS Feature that determines whether time values that represents time periods (durations, periods, ranges) are to be serialized by default using a numeric (true) or textual (false) representations. Note that numeric representation may mean either simple number, or an array of numbers, depending on type.
Feature used to be one of Feature is disabled by default as of Jackson 3.0 (in 2.x it was enabled), so that period/duration are by default serialized as textual values, NOT timestamps. | |
| DateTimeFeature | back to summary |
|---|---|
| private DateTimeFeature(boolean enabledByDefault) | |
| enabledByDefault | back to summary |
|---|---|
| public boolean enabledByDefault() Implements tools. Doc from tools. Accessor for checking whether this feature is enabled by default.
| |
| enabledIn | back to summary |
|---|---|
| public boolean enabledIn(int flags) Implements tools. Doc from tools. Convenience method for checking whether feature is enabled in given bitmask.
| |
| featureIndex | back to summary |
|---|---|
| public int featureIndex() Implements tools. Doc from tools. Internal index used for efficient storage and index; no user serviceable contents inside!
| |
| getMask | back to summary |
|---|---|
| public int getMask() Implements tools. Doc from tools. Returns bit mask for this feature instance; must be a single bit,
that is of form
| |
| valueOf | back to summary |
|---|---|
| public static DateTimeFeature valueOf(String name) | |
| values | back to summary |
|---|---|
| public static DateTimeFeature[] values() | |