-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8cc669f
commit 389dc9d
Showing
66 changed files
with
6,181 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
[Jackson](../../../jackson) datatype module (jar) | ||
to support JSON serialization and deserialization of | ||
[Guava](http://code.google.com/p/guava-libraries/) data types. | ||
|
||
## Status | ||
|
||
[](https://maven-badges.herokuapp.com/maven-central/com.fasterxml.jackson.datatype/jackson-datatype-guava/) | ||
[](http://www.javadoc.io/doc/com.fasterxml.jackson.datatype/jackson-datatype-guava) | ||
|
||
Module has been production-ready since version 2.3. | ||
Not all datatypes of Guava are support due to sheer size of the library; new support is added based on contributions. | ||
|
||
## License | ||
|
||
[Apache License 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) | ||
|
||
## Usage | ||
|
||
### Maven dependency | ||
|
||
To use module on Maven-based projects, use following dependency: | ||
|
||
```xml | ||
<dependency> | ||
<groupId>com.fasterxml.jackson.datatype</groupId> | ||
<artifactId>jackson-datatype-guava</artifactId> | ||
<version>2.7.3</version> | ||
</dependency> | ||
``` | ||
|
||
(or whatever version is most up-to-date at the moment) | ||
|
||
### Registering module | ||
|
||
Like all standard Jackson modules (libraries that implement Module interface), registration is done as follows: | ||
|
||
```java | ||
ObjectMapper mapper = new ObjectMapper() | ||
.registerModule(new GuavaModule()); | ||
``` | ||
|
||
after which functionality is available for all normal Jackson operations. | ||
|
||
### Configuration | ||
|
||
Configurable settings of the module are: | ||
|
||
* `configureAbsentsAsNulls` (default: true) (added in 2.6) | ||
* If enabled, will consider `Optional.absent()` to be "null-equivalent", and NOT serialized if inclusion is defined as `Include.NON_NULL` | ||
* If disabled, `Optional.absent()` behaves as standard referential type, and is included with `Include.NON_NULL` | ||
* In either case, `Optional.absent()` values are always excluded with Inclusion values of: | ||
* NON_EMPTY | ||
* NON_ABSENT (new in Jackson 2.6) | ||
|
||
## More | ||
|
||
See [Wiki](../../wiki) for more information (javadocs, downloads). | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<parent> | ||
<groupId>com.fasterxml.jackson.datatype</groupId> | ||
<artifactId>jackson-datatypes-collections</artifactId> | ||
<version>2.7.4-SNAPSHOT</version> | ||
</parent> | ||
<artifactId>jackson-datatype-guava</artifactId> | ||
<name>Jackson datatype: Guava</name> | ||
<packaging>bundle</packaging> | ||
<description>Add-on datatype-support module for Jackson (https://github.com/FasterXML/jackson) that handles | ||
Guava (http://code.google.com/p/guava-libraries/) types (currently mostly just collection ones) | ||
</description> | ||
<url>https://github.com/FasterXML/jackson-datatypes-collections</url> | ||
|
||
<contributors> | ||
<contributor> | ||
<name>Steven Schlansker</name> | ||
<email>[email protected]</email> | ||
</contributor> | ||
</contributors> | ||
|
||
<properties> | ||
<!-- 27-Nov-2015, tatu: For Jackson 2.7, move guava dep from 15 to 16 --> | ||
<version.guava>16.0</version.guava> | ||
|
||
<!-- 11-Sep-2015, tatu: As per [datatype-guava#80] --> | ||
<version.guava.osgi>[${version.guava}.0,20)</version.guava.osgi> | ||
|
||
<!-- Generate PackageVersion.java into this directory. --> | ||
<packageVersion.dir>com/fasterxml/jackson/datatype/guava</packageVersion.dir> | ||
<packageVersion.package>${project.groupId}.guava</packageVersion.package> | ||
<!-- 28-Sep-2015, tatu: Export should work with defaults, but imports need | ||
an override because we want wider range of versions for Guava | ||
--> | ||
<osgi.import> | ||
com.google.common.*;version="${version.guava.osgi}", | ||
* | ||
</osgi.import> | ||
</properties> | ||
|
||
<dependencies> | ||
<!-- Extends Jackson; supports Guava datatypes, so: --> | ||
<dependency> | ||
<groupId>com.fasterxml.jackson.core</groupId> | ||
<artifactId>jackson-databind</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.fasterxml.jackson.core</groupId> | ||
<artifactId>jackson-core</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.google.guava</groupId> | ||
<artifactId>guava</artifactId> | ||
<version>${version.guava}</version> | ||
</dependency> | ||
</dependencies> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>com.google.code.maven-replacer-plugin</groupId> | ||
<artifactId>replacer</artifactId> | ||
<executions> | ||
<execution> | ||
<id>process-packageVersion</id> | ||
<phase>generate-sources</phase> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-surefire-plugin</artifactId> | ||
<configuration> | ||
<excludes> | ||
<exclude>com/fasterxml/jackson/**/failing/*.java</exclude> | ||
</excludes> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
Here are people who have contributed to the development of Jackson JSON processor | ||
Guava datatype component, version 2.x | ||
(version numbers in brackets indicate release in which the problem was fixed) | ||
|
||
Tatu Saloranta ([email protected]): author | ||
|
||
Steven Schlansker ([email protected]): co-author | ||
|
||
Stephan Schroevers: (Stephan202@github) | ||
* Contributed #56: Add support `HashCode` | ||
(2.5.0) | ||
* Contributed #65: Add deserialization support for SortedMultiset and ImmutableSortedMultiset | ||
(2.5.3) | ||
|
||
Michael Hixson: | ||
* Contributed fix for #67: Support deserializing ImmutableSetMultimaps | ||
(2.6.0) | ||
|
||
Alexey Kobyakov (akobiakov@github) | ||
* Reported #64: `@JsonUnwrapped` annotation is ignored when a field is an Optional | ||
(2.6.0) | ||
|
||
Jose Thomas (josethomas@github) | ||
* Contributed #52: Guava collection types do not allow null values | ||
(2.6.2) | ||
|
||
Jonathan Rodrigues de Oliveira (jorool@github) | ||
* Contributed #79: New configuration for Guava Range default bound type. | ||
(2.7.0) | ||
|
||
Micahel Jameson (mjameson-se@github) | ||
* Reported #87: OSGi import missing for `com.fasterxml.jackson.annotation.JsonInclude$Value` | ||
(2.7.1) |
Oops, something went wrong.