Module io.ebean.api

Package io.ebean.text.json


package io.ebean.text.json
JSON formatting and parsing objects (See JsonContext).

The goal is to provide JSON support taking into account various ORM issues such as partial objects (for fetching and updating), reference beans and bi-directional relationships.

Example:


  // find some customers ...

 List<Customer> list = DB.find(Customer.class)
     .select("id, name, status, shippingAddress")
     .fetch("billingAddress","line1, city")
     .fetch("billingAddress.country", "*")
     .fetch("contacts", "firstName,email")
     .order().desc("id")
     .findList();

 JsonContext json = DB.json();

  // output as a JSON string
 String jsonOutput = json.toJson(list);

 
  • Class
    Description
    Utility that converts between JSON content and simple java Maps/Lists.
    Provides a JSON reader that can hold a persistence context and load context while reading JSON.
    Converts objects to and from JSON format.
    Unchecked exception thrown when an IOException occurs in json processing.
    Provides for custom handling of json content as it is read.
    Provides the ability to customise the reading of JSON content.
    Allows for customising the JSON write processing.
    Provides options for customising the JSON write process.
    Wraps an underlying JsonGenerator taking into account null suppression and exposing isIncludeEmpty() etc.