Package io.avaje.jsonb

Core API of Jsonb.

Initialise with defaults


   Jsonb jsonb = Jsonb.builder().build();
 

Initialise with some configuration


   Jsonb jsonb = Jsonb.builder()
     .serializeNulls(true)
     .serializeEmpty(true)
     .failOnUnknown(true)
     .build();
 

fromJson

Read json content from: String, byte[], Reader, InputStream, JsonReader



  JsonType<Customer> customerType = jsonb.type(Customer.class);

  Customer customer = customerType.fromJson(content);

 

toJson

Write json content to: String, byte[], Writer, OutputStream, JsonWriter



  JsonType<Customer> customerType = jsonb.type(Customer.class);

  String asJson = customerType.toJson(customer);

 
See Also:
Jsonb, JsonType