|
35 | 35 | import tools.jackson.databind.ser.std.ToStringSerializer; |
36 | 36 |
|
37 | 37 | /** |
38 | | - * Class that registers capability of serializing {@code java.time} objects with the Jackson core. |
| 38 | + * Class that registers capability of deserializing and serializing (reading and writing) |
| 39 | + * {@code java.time} values with the Jackson core. |
39 | 40 | *<p> |
40 | 41 | * In Jackson 3, the module is embedded in databind and handlers are automatically |
41 | 42 | * registered: approach is similar to one used by full {@link JacksonModule}s. |
42 | 43 | *<p> |
43 | 44 | * Most {@code java.time} types are serialized as numbers (integers or decimals as appropriate) if the |
44 | | - * {@link tools.jackson.databind.SerializationFeature#WRITE_DATES_AS_TIMESTAMPS} feature is enabled |
| 45 | + * {@link SerializationFeature#WRITE_DATES_AS_TIMESTAMPS} feature is enabled |
45 | 46 | * (or, for {@link Duration}, {@link tools.jackson.databind.SerializationFeature#WRITE_DURATIONS_AS_TIMESTAMPS}), |
46 | 47 | * and otherwise are serialized in standard |
47 | 48 | * <a href="http://en.wikipedia.org/wiki/ISO_8601" target="_blank">ISO-8601</a> string representation. |
|
50 | 51 | * have built-in translation to and from ISO-8601 formats. |
51 | 52 | * <p> |
52 | 53 | * Granularity of timestamps is controlled through the companion features |
53 | | - * {@link tools.jackson.databind.SerializationFeature#WRITE_DATE_TIMESTAMPS_AS_NANOSECONDS} and |
54 | | - * {@link tools.jackson.databind.DeserializationFeature#READ_DATE_TIMESTAMPS_AS_NANOSECONDS}. For serialization, timestamps are |
| 54 | + * {@link SerializationFeature#WRITE_DATE_TIMESTAMPS_AS_NANOSECONDS} and |
| 55 | + * {@link DeserializationFeature#READ_DATE_TIMESTAMPS_AS_NANOSECONDS}. For serialization, timestamps are |
55 | 56 | * written as fractional numbers (decimals), where the number is seconds and the decimal is fractional seconds, if |
56 | 57 | * {@code WRITE_DATE_TIMESTAMPS_AS_NANOSECONDS} is enabled (it is by default), with resolution as fine as nanoseconds depending on the |
57 | 58 | * underlying JDK implementation. If {@code WRITE_DATE_TIMESTAMPS_AS_NANOSECONDS} is disabled, timestamps are written as a whole number of |
|
61 | 62 | * <p> |
62 | 63 | * Some exceptions to this standard serialization/deserialization rule: |
63 | 64 | * <ul> |
64 | | - * <li>{@link Period}, which always results in an ISO-8601 format because Periods must be represented in years, months, and/or days.</li> |
65 | | - * <li>{@link Year}, which only contains a year and cannot be represented with a timestamp.</li> |
66 | | - * <li>{@link YearMonth}, which only contains a year and a month and cannot be represented with a timestamp.</li> |
67 | | - * <li>{@link MonthDay}, which only contains a month and a day and cannot be represented with a timestamp.</li> |
68 | | - * <li>{@link ZoneId} and {@link ZoneOffset}, which do not actually store dates and times but are supported with this module nonetheless.</li> |
| 65 | + * <li>{@link Period}, which always results in an ISO-8601 format because Periods must be represented in years, months, and/or days. |
| 66 | + * </li> |
| 67 | + * <li>{@link Year}, which only contains a year and cannot be represented with a timestamp. |
| 68 | + * </li> |
| 69 | + * <li>{@link YearMonth}, which only contains a year and a month and cannot be represented with a timestamp. |
| 70 | + * </li> |
| 71 | + * <li>{@link MonthDay}, which only contains a month and a day and cannot be represented with a timestamp. |
| 72 | + * </li> |
| 73 | + * <li>{@link ZoneId} and {@link ZoneOffset}, which do not actually store dates and times but are supported with this module nonetheless. |
| 74 | + * </li> |
69 | 75 | * <li>{@link LocalDate}, {@link LocalTime}, {@link LocalDateTime}, and {@link OffsetTime}, which cannot portably be converted to timestamps |
70 | | - * and are instead represented as arrays when WRITE_DATES_AS_TIMESTAMPS is enabled.</li> |
| 76 | + * and are instead represented as arrays when WRITE_DATES_AS_TIMESTAMPS is enabled. |
| 77 | + * </li> |
71 | 78 | * </ul> |
72 | 79 | */ |
73 | 80 | public final class JavaTimeInitializer |
|
0 commit comments