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);

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