Jackson Lombok
This repository contains extension for Jackson which allows better interoperability with Lombok classes.
The JacksonLombokAnnotationIntrospector
allows Jackson to serialize and deserialize classes with constructors that are annotated with the java.beans.ConstructorProperties annotations. Lombok will automatically add this annotation to the constructors it generates.
Usage
Add the JacksonLombokAnnotationIntrospector
to the Jackson ObjectMapper
in the following manner.
new ObjectMapper()
.setAnnotationIntrospector(new JacksonLombokAnnotationIntrospector());
Now you can serialize and deserialize Lombok objects with generated constructors like the following class.
@Value
private static class ImmutablePojo {
@JsonProperty("new_name")
String name;
@JsonProperty
String string;
}
##Installation Add the following maven depency
<dependency>
<groupId>com.xebia</groupId>
<artifactId>jackson-lombok</artifactId>
<version>1.0</version>
</dependency>
##Licence All files are provided under an MIT license.