Class DJsonService

java.lang.Object
io.ebeaninternal.json.DJsonService
All Implemented Interfaces:
io.ebean.service.BootstrapService, io.ebean.service.SpiJsonService

public final class DJsonService extends Object implements io.ebean.service.SpiJsonService
Utility that converts between JSON content and simple java Maps/Lists.

Backed by avaje JsonMapper using EbeanJsonAdapter which preserves Ebean's modify-aware collection and number semantics.

  • Constructor Details

    • DJsonService

      public DJsonService()
  • Method Details

    • write

      public String write(Object object) throws IOException
      Specified by:
      write in interface io.ebean.service.SpiJsonService
      Throws:
      IOException
    • write

      public void write(Object object, Writer writer) throws IOException
      Specified by:
      write in interface io.ebean.service.SpiJsonService
      Throws:
      IOException
    • write

      public void write(Object object, io.avaje.json.JsonWriter jsonWriter) throws IOException
      Specified by:
      write in interface io.ebean.service.SpiJsonService
      Throws:
      IOException
    • writeCollection

      public void writeCollection(Collection<Object> collection, io.avaje.json.JsonWriter jsonWriter) throws IOException
      Specified by:
      writeCollection in interface io.ebean.service.SpiJsonService
      Throws:
      IOException
    • parseObject

      public Map<String,Object> parseObject(String json, boolean modifyAware) throws IOException
      Specified by:
      parseObject in interface io.ebean.service.SpiJsonService
      Throws:
      IOException
    • parseObject

      public Map<String,Object> parseObject(String json) throws IOException
      Specified by:
      parseObject in interface io.ebean.service.SpiJsonService
      Throws:
      IOException
    • parseObject

      public Map<String,Object> parseObject(Reader reader, boolean modifyAware) throws IOException
      Specified by:
      parseObject in interface io.ebean.service.SpiJsonService
      Throws:
      IOException
    • parseObject

      public Map<String,Object> parseObject(Reader reader) throws IOException
      Specified by:
      parseObject in interface io.ebean.service.SpiJsonService
      Throws:
      IOException
    • parseObject

      public Map<String,Object> parseObject(io.avaje.json.JsonReader parser) throws IOException
      Specified by:
      parseObject in interface io.ebean.service.SpiJsonService
      Throws:
      IOException
    • parseObject

      public Map<String,Object> parseObject(io.avaje.json.JsonReader parser, io.avaje.json.JsonReader.Token token) throws IOException
      Specified by:
      parseObject in interface io.ebean.service.SpiJsonService
      Throws:
      IOException
    • parseList

      public <T> List<T> parseList(String json, boolean modifyAware) throws IOException
      Specified by:
      parseList in interface io.ebean.service.SpiJsonService
      Throws:
      IOException
    • parseList

      public List<Object> parseList(String json) throws IOException
      Specified by:
      parseList in interface io.ebean.service.SpiJsonService
      Throws:
      IOException
    • parseList

      public List<Object> parseList(Reader reader) throws IOException
      Specified by:
      parseList in interface io.ebean.service.SpiJsonService
      Throws:
      IOException
    • parseList

      public List<Object> parseList(io.avaje.json.JsonReader parser) throws IOException
      Specified by:
      parseList in interface io.ebean.service.SpiJsonService
      Throws:
      IOException
    • parseList

      public <T> List<T> parseList(io.avaje.json.JsonReader parser, io.avaje.json.JsonReader.Token currentToken) throws IOException
      Specified by:
      parseList in interface io.ebean.service.SpiJsonService
      Throws:
      IOException
    • parse

      public Object parse(String json) throws IOException
      Specified by:
      parse in interface io.ebean.service.SpiJsonService
      Throws:
      IOException
    • parse

      public Object parse(Reader reader) throws IOException
      Specified by:
      parse in interface io.ebean.service.SpiJsonService
      Throws:
      IOException
    • parse

      public Object parse(io.avaje.json.JsonReader parser) throws IOException
      Specified by:
      parse in interface io.ebean.service.SpiJsonService
      Throws:
      IOException
    • parseSet

      public <T> Set<T> parseSet(String json, boolean modifyAware) throws IOException
      Specified by:
      parseSet in interface io.ebean.service.SpiJsonService
      Throws:
      IOException
    • parseSet

      public <T> Set<T> parseSet(io.avaje.json.JsonReader parser, io.avaje.json.JsonReader.Token currentToken) throws IOException
      Specified by:
      parseSet in interface io.ebean.service.SpiJsonService
      Throws:
      IOException