Class DJsonContext

java.lang.Object
io.ebeaninternal.server.json.DJsonContext
All Implemented Interfaces:
io.ebean.text.json.JsonContext, SpiJsonContext

public final class DJsonContext extends Object implements SpiJsonContext
Default implementation of JsonContext.
  • Constructor Details

    • DJsonContext

      public DJsonContext(SpiEbeanServer server, com.fasterxml.jackson.core.JsonFactory jsonFactory, TypeManager typeManager)
  • Method Details

    • writeScalar

      public void writeScalar(com.fasterxml.jackson.core.JsonGenerator generator, Object scalarValue) throws IOException
      Specified by:
      writeScalar in interface io.ebean.text.json.JsonContext
      Throws:
      IOException
    • isSupportedType

      public boolean isSupportedType(Type genericType)
      Specified by:
      isSupportedType in interface io.ebean.text.json.JsonContext
    • createGenerator

      public com.fasterxml.jackson.core.JsonGenerator createGenerator(Writer writer) throws io.ebean.text.json.JsonIOException
      Specified by:
      createGenerator in interface io.ebean.text.json.JsonContext
      Throws:
      io.ebean.text.json.JsonIOException
    • createParser

      public com.fasterxml.jackson.core.JsonParser createParser(Reader reader) throws io.ebean.text.json.JsonIOException
      Specified by:
      createParser in interface io.ebean.text.json.JsonContext
      Throws:
      io.ebean.text.json.JsonIOException
    • toBean

      public <T> T toBean(Class<T> cls, String json) throws io.ebean.text.json.JsonIOException
      Specified by:
      toBean in interface io.ebean.text.json.JsonContext
      Throws:
      io.ebean.text.json.JsonIOException
    • toBean

      public <T> T toBean(Class<T> cls, String json, io.ebean.text.json.JsonReadOptions options) throws io.ebean.text.json.JsonIOException
      Specified by:
      toBean in interface io.ebean.text.json.JsonContext
      Throws:
      io.ebean.text.json.JsonIOException
    • toBean

      public <T> T toBean(Class<T> cls, Reader jsonReader) throws io.ebean.text.json.JsonIOException
      Specified by:
      toBean in interface io.ebean.text.json.JsonContext
      Throws:
      io.ebean.text.json.JsonIOException
    • toBean

      public <T> T toBean(Class<T> cls, Reader jsonReader, io.ebean.text.json.JsonReadOptions options) throws io.ebean.text.json.JsonIOException
      Specified by:
      toBean in interface io.ebean.text.json.JsonContext
      Throws:
      io.ebean.text.json.JsonIOException
    • toBean

      public <T> T toBean(Class<T> cls, com.fasterxml.jackson.core.JsonParser parser) throws io.ebean.text.json.JsonIOException
      Specified by:
      toBean in interface io.ebean.text.json.JsonContext
      Throws:
      io.ebean.text.json.JsonIOException
    • toBean

      public <T> T toBean(Class<T> cls, com.fasterxml.jackson.core.JsonParser parser, io.ebean.text.json.JsonReadOptions options) throws io.ebean.text.json.JsonIOException
      Specified by:
      toBean in interface io.ebean.text.json.JsonContext
      Throws:
      io.ebean.text.json.JsonIOException
    • toBean

      public <T> void toBean(T target, String json) throws io.ebean.text.json.JsonIOException
      Specified by:
      toBean in interface io.ebean.text.json.JsonContext
      Throws:
      io.ebean.text.json.JsonIOException
    • toBean

      public <T> void toBean(T target, String json, io.ebean.text.json.JsonReadOptions options) throws io.ebean.text.json.JsonIOException
      Specified by:
      toBean in interface io.ebean.text.json.JsonContext
      Throws:
      io.ebean.text.json.JsonIOException
    • toBean

      public <T> void toBean(T target, Reader jsonReader) throws io.ebean.text.json.JsonIOException
      Specified by:
      toBean in interface io.ebean.text.json.JsonContext
      Throws:
      io.ebean.text.json.JsonIOException
    • toBean

      public <T> void toBean(T target, Reader jsonReader, io.ebean.text.json.JsonReadOptions options) throws io.ebean.text.json.JsonIOException
      Specified by:
      toBean in interface io.ebean.text.json.JsonContext
      Throws:
      io.ebean.text.json.JsonIOException
    • toBean

      public <T> void toBean(T target, com.fasterxml.jackson.core.JsonParser parser) throws io.ebean.text.json.JsonIOException
      Specified by:
      toBean in interface io.ebean.text.json.JsonContext
      Throws:
      io.ebean.text.json.JsonIOException
    • toBean

      public <T> void toBean(T target, com.fasterxml.jackson.core.JsonParser parser, io.ebean.text.json.JsonReadOptions options) throws io.ebean.text.json.JsonIOException
      Specified by:
      toBean in interface io.ebean.text.json.JsonContext
      Throws:
      io.ebean.text.json.JsonIOException
    • createBeanReader

      public <T> DJsonBeanReader<T> createBeanReader(Class<T> cls, com.fasterxml.jackson.core.JsonParser parser, io.ebean.text.json.JsonReadOptions options) throws io.ebean.text.json.JsonIOException
      Specified by:
      createBeanReader in interface io.ebean.text.json.JsonContext
      Throws:
      io.ebean.text.json.JsonIOException
    • createBeanReader

      public <T> DJsonBeanReader<T> createBeanReader(io.ebean.plugin.BeanType<T> beanType, com.fasterxml.jackson.core.JsonParser parser, io.ebean.text.json.JsonReadOptions options) throws io.ebean.text.json.JsonIOException
      Specified by:
      createBeanReader in interface io.ebean.text.json.JsonContext
      Throws:
      io.ebean.text.json.JsonIOException
    • toList

      public <T> List<T> toList(Class<T> cls, String json) throws io.ebean.text.json.JsonIOException
      Specified by:
      toList in interface io.ebean.text.json.JsonContext
      Throws:
      io.ebean.text.json.JsonIOException
    • toList

      public <T> List<T> toList(Class<T> cls, String json, io.ebean.text.json.JsonReadOptions options) throws io.ebean.text.json.JsonIOException
      Specified by:
      toList in interface io.ebean.text.json.JsonContext
      Throws:
      io.ebean.text.json.JsonIOException
    • toList

      public <T> List<T> toList(Class<T> cls, Reader jsonReader) throws io.ebean.text.json.JsonIOException
      Specified by:
      toList in interface io.ebean.text.json.JsonContext
      Throws:
      io.ebean.text.json.JsonIOException
    • toList

      public <T> List<T> toList(Class<T> cls, Reader jsonReader, io.ebean.text.json.JsonReadOptions options) throws io.ebean.text.json.JsonIOException
      Specified by:
      toList in interface io.ebean.text.json.JsonContext
      Throws:
      io.ebean.text.json.JsonIOException
    • toList

      public <T> List<T> toList(Class<T> cls, com.fasterxml.jackson.core.JsonParser src) throws io.ebean.text.json.JsonIOException
      Specified by:
      toList in interface io.ebean.text.json.JsonContext
      Throws:
      io.ebean.text.json.JsonIOException
    • toList

      public <T> List<T> toList(Class<T> cls, com.fasterxml.jackson.core.JsonParser src, io.ebean.text.json.JsonReadOptions options) throws io.ebean.text.json.JsonIOException
      Specified by:
      toList in interface io.ebean.text.json.JsonContext
      Throws:
      io.ebean.text.json.JsonIOException
    • toObject

      public Object toObject(Type genericType, String json) throws io.ebean.text.json.JsonIOException
      Specified by:
      toObject in interface io.ebean.text.json.JsonContext
      Throws:
      io.ebean.text.json.JsonIOException
    • toObject

      public Object toObject(Type genericType, Reader json) throws io.ebean.text.json.JsonIOException
      Specified by:
      toObject in interface io.ebean.text.json.JsonContext
      Throws:
      io.ebean.text.json.JsonIOException
    • toObject

      public Object toObject(Type genericType, com.fasterxml.jackson.core.JsonParser jsonParser) throws io.ebean.text.json.JsonIOException
      Specified by:
      toObject in interface io.ebean.text.json.JsonContext
      Throws:
      io.ebean.text.json.JsonIOException
    • toJson

      public void toJson(Object value, com.fasterxml.jackson.core.JsonGenerator generator) throws io.ebean.text.json.JsonIOException
      Specified by:
      toJson in interface io.ebean.text.json.JsonContext
      Throws:
      io.ebean.text.json.JsonIOException
    • toJson

      public void toJson(Object value, com.fasterxml.jackson.core.JsonGenerator generator, io.ebean.FetchPath fetchPath) throws io.ebean.text.json.JsonIOException
      Specified by:
      toJson in interface io.ebean.text.json.JsonContext
      Throws:
      io.ebean.text.json.JsonIOException
    • toJson

      public void toJson(Object o, com.fasterxml.jackson.core.JsonGenerator generator, io.ebean.text.json.JsonWriteOptions options) throws io.ebean.text.json.JsonIOException
      Specified by:
      toJson in interface io.ebean.text.json.JsonContext
      Throws:
      io.ebean.text.json.JsonIOException
    • toJson

      public void toJson(Object o, Writer writer) throws io.ebean.text.json.JsonIOException
      Specified by:
      toJson in interface io.ebean.text.json.JsonContext
      Throws:
      io.ebean.text.json.JsonIOException
    • toJson

      public String toJson(Object value, io.ebean.FetchPath fetchPath) throws io.ebean.text.json.JsonIOException
      Specified by:
      toJson in interface io.ebean.text.json.JsonContext
      Throws:
      io.ebean.text.json.JsonIOException
    • toJson

      public void toJson(Object o, Writer writer, io.ebean.FetchPath fetchPath) throws io.ebean.text.json.JsonIOException
      Specified by:
      toJson in interface io.ebean.text.json.JsonContext
      Throws:
      io.ebean.text.json.JsonIOException
    • toJson

      public void toJson(Object o, Writer writer, io.ebean.text.json.JsonWriteOptions options) throws io.ebean.text.json.JsonIOException
      Specified by:
      toJson in interface io.ebean.text.json.JsonContext
      Throws:
      io.ebean.text.json.JsonIOException
    • toJsonPretty

      public String toJsonPretty(Object value) throws io.ebean.text.json.JsonIOException
      Specified by:
      toJsonPretty in interface io.ebean.text.json.JsonContext
      Throws:
      io.ebean.text.json.JsonIOException
    • toJson

      public String toJson(Object o) throws io.ebean.text.json.JsonIOException
      Specified by:
      toJson in interface io.ebean.text.json.JsonContext
      Throws:
      io.ebean.text.json.JsonIOException
    • toJson

      public String toJson(Object o, io.ebean.text.json.JsonWriteOptions options) throws io.ebean.text.json.JsonIOException
      Specified by:
      toJson in interface io.ebean.text.json.JsonContext
      Throws:
      io.ebean.text.json.JsonIOException
    • createJsonRead

      public SpiJsonReader createJsonRead(io.ebean.plugin.BeanType<?> beanType, String json)
      Description copied from interface: SpiJsonContext
      Create a Json Reader for reading the JSON content.
      Specified by:
      createJsonRead in interface SpiJsonContext
    • createJsonWriter

      public SpiJsonWriter createJsonWriter(Writer writer)
      Description copied from interface: SpiJsonContext
      Create a Json Writer for writing beans as JSON supplying a writer.
      Specified by:
      createJsonWriter in interface SpiJsonContext
    • createJsonWriter

      public SpiJsonWriter createJsonWriter(com.fasterxml.jackson.core.JsonGenerator gen, io.ebean.text.json.JsonWriteOptions options)
      Description copied from interface: SpiJsonContext
      Create a Json Writer for writing beans as JSON.
      Specified by:
      createJsonWriter in interface SpiJsonContext