Java and Scala JSON conversion library.
Genson API is designed to be easy to use, it handles for you all the databinding, streaming and much more.
Highly modular architecture and configurable via the GensonBuilder.
new Genson().deserialize("{}", AwesomeBean.class);
Full support of generic types, polymorphic types and immutable objects that don't provide a default constructor.
new GensonBuilder()
.useDateFormat(new SimpleDateFormat("yyyy-MM-dd"))
.useIndentation(true)
.useConstructorWithArguments(true)
.create();
new Genson().serialize(
Json.createArrayBuilder()
.add(1)
.add(2)
.build()
);
public class Bean {
@XmlJavaTypeAdapter(BeanAdapter.class)
private ComplexType complexObject;
@XmlTransient
private String password;
}
<dependency>
<groupId>com.owlike</groupId>
<artifactId>genson</artifactId>
<version>1.6</version>
</dependency>