Skip to content

Commit c1560f1

Browse files
committed
Merge branch '2.9' of github.com:FasterXML/jackson-modules-java8 into 2.9
2 parents 6b55496 + 2f7df8a commit c1560f1

File tree

2 files changed

+17
-4
lines changed

2 files changed

+17
-4
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ jdk:
77
branches:
88
only:
99
- master
10-
- "2.8"
10+
- "2.9"

README.md

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,24 @@ modules needed to support Java 8 features when core Jackson modules do not
55
(yet) require Java 8 runtime (note: Jackson 3.0 will likely increase baseline
66
and allow including some or all of this functionality)
77

8-
This includes 3 modules:
8+
For Jackson 2.x this includes 3 modules:
99

1010
* [Parameter names](parameter-names/): support for detecting constructor and factory method ("creator") parameters without having to use `@JsonProperty` annotation
11+
* provides `com.fasterxml.jackson.module.paramnames.ParameterNamesModule`
1112
* [Java 8 Date/time](datetime): support for Java 8 date/time types (specified in JSR-310 specification)
13+
* provides `com.fasterxml.jackson.datatype.jsr310.JavaTimeModule`
14+
* ALSO provides legacy variant `com.fasterxml.jackson.datatype.jsr310.JSR310TimeModule`
15+
* difference between 2 modules is that of configuration defaults: use of `JavaTimeModule` strongly recommended for new code
1216
* [Java 8 Datatypes](datatypes): support for other new Java 8 datatypes outside of date/time: most notably `Optional`, `OptionalLong`, `OptionalDouble`
17+
* provides `com.fasterxml.jackson.datatype.jdk8.Jdk8Module`
1318

1419
all of which are built from this repository, and accessed and used as separate Jackson modules
1520
(with separate Maven artifacts).
1621

22+
Jackson 3.x changes things so that `parameter-names` and `datatypes` modules are merged into `jackson-databind`
23+
and need not be registered; `datetime` module (`JavaTimeModule`) remains separate module due to its size
24+
and configurability options.
25+
1726
## License
1827

1928
All modules are licensed under [Apache License 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt).
@@ -52,7 +61,7 @@ and either include versions directly, OR, preferably, import
5261
ObjectMapper mapper = new ObjectMapper()
5362
.registerModule(new ParameterNamesModule())
5463
.registerModule(new Jdk8Module())
55-
.registerModule(new JavaTimeModule())
64+
.registerModule(new JavaTimeModule()) // new module, NOT JSR310Module
5665
;
5766
```
5867

@@ -65,7 +74,11 @@ mapper.findAndRegisterModules();
6574

6675
Either way, after registration all functionality is available for all normal Jackson operations.
6776

77+
*WARNING* - As of Jackson 2.x, auto-registration will only register older `JSR310Module`, and not newer
78+
`JavaTimeModule` -- this is due to backwards compatibility. Because of this make sure to either use explicit
79+
registration, or, if you want to use `JavaTimeModule` but also auto-registration, make sure to
80+
register `JavaTimeModule` BEFORE calling `mapper.findAndRegisterModules()`).
81+
6882
## More
6983

7084
See [Wiki](../../wiki) for more information (javadocs).
71-

0 commit comments

Comments
 (0)