Skip to content

Commit

Permalink
Work on #794: add the feature.
Browse files Browse the repository at this point in the history
  • Loading branch information
cowtowncoder committed May 18, 2015
1 parent ad513ee commit 6709f72
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 12 deletions.
2 changes: 2 additions & 0 deletions release-notes/VERSION
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ Project: jackson-databind
(suggested by rgoldberg@githin)
#790: Add `JsonNode.equals(Comparator<JsonNode>, JsonNode)` to support
configurable/external equality comparison
#794: Add `SerializationFeature.WRITE_DATES_WITH_ZONE_ID` to allow inclusion/exclusion of
timezone id for date/time values (as opposed to timezone offset)
- Remove old cglib compatibility tests; cause problems in Eclipse

2.5.4 (not yet released)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ public enum SerializationFeature implements ConfigFeature
*/

/**
* Feature that determines whether {@link java.util.Date} values
* Feature that determines whether Date (and date/time) values
* (and Date-based things like {@link java.util.Calendar}s) are to be
* serialized as numeric timestamps (true; the default),
* or as something else (usually textual representation).
Expand All @@ -185,7 +185,20 @@ public enum SerializationFeature implements ConfigFeature
WRITE_DATES_AS_TIMESTAMPS(true),

/**
* Feature that determines whether time values that represents time periods
* Feature that determines whether {@link java.util.Date}s
* (and sub-types) used as {@link java.util.Map} keys are serialized
* as timestamps or not (if not, will be serialized as textual
* values).
*<p>
* Default value is 'false', meaning that Date-valued Map keys are serialized
* as textual (ISO-8601) values.
*<p>
* Feature is disabled by default.
*/
WRITE_DATE_KEYS_AS_TIMESTAMPS(false),

/**
* Feature that determines whether date/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,
Expand All @@ -199,21 +212,25 @@ public enum SerializationFeature implements ConfigFeature
*
* @since 2.5
*/
WRITE_DURATIONS_AS_TIMESTAMPS(true),
WRITE_DATES_WITH_ZONE_ID(false),

/**
* Feature that determines whether {@link java.util.Date}s
* (and sub-types) used as {@link java.util.Map} keys are serialized
* as timestamps or not (if not, will be serialized as textual
* values).
* 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.
*<p>
* Default value is 'false', meaning that Date-valued Map keys are serialized
* as textual (ISO-8601) values.
* Note: whether {@link java.util.Map} keys are serialized as Strings
* or not is controlled using {@link #WRITE_DATE_KEYS_AS_TIMESTAMPS}.
*<p>
* Feature is disabled by default.
* Feature is enabled by default, so that period/duration are by default
* serialized as timestamps.
*
* @since 2.5
*/
WRITE_DATE_KEYS_AS_TIMESTAMPS(false),

WRITE_DURATIONS_AS_TIMESTAMPS(true),
/**
* Feature that determines how type <code>char[]</code> is serialized:
* when enabled, will be serialized as an explict JSON array (with
Expand Down

0 comments on commit 6709f72

Please sign in to comment.