Module io.ebean.api

Class JsonReadOptions

java.lang.Object
io.ebean.text.json.JsonReadOptions

public class JsonReadOptions extends Object
Provides the ability to customise the reading of JSON content.

You can register JsonReadBeanVisitors to customise the processing of the beans as they are processed and handle any custom JSON elements that could not be mapped to bean properties.

  • Field Details

  • Constructor Details

    • JsonReadOptions

      public JsonReadOptions()
      Default constructor.
  • Method Details

    • getVisitorMap

      public Map<String,JsonReadBeanVisitor<?>> getVisitorMap()
      Return the map of JsonReadBeanVisitor's.
    • addRootVisitor

      public JsonReadOptions addRootVisitor(JsonReadBeanVisitor<?> visitor)
      Register a JsonReadBeanVisitor for the root level.
    • addVisitor

      public JsonReadOptions addVisitor(String path, JsonReadBeanVisitor<?> visitor)
      Register a JsonReadBeanVisitor for a given path.
    • isEnableLazyLoading

      public boolean isEnableLazyLoading()
      Return true if lazy loading is enabled after the objects are loaded.
    • setEnableLazyLoading

      public JsonReadOptions setEnableLazyLoading(boolean enableLazyLoading)
      Set to true to enable lazy loading on partially populated beans.

      If this is set to true a persistence context will be created if one has not already been supplied.

    • getObjectMapper

      public Object getObjectMapper()
      Return the Jackson ObjectMapper to use (if not wanted to use the objectMapper set on the DatabaseConfig).
    • setObjectMapper

      public JsonReadOptions setObjectMapper(Object objectMapper)
      Set the Jackson ObjectMapper to use (if not wanted to use the objectMapper set on the DatabaseConfig).
    • setPersistenceContext

      public JsonReadOptions setPersistenceContext(PersistenceContext persistenceContext)
      Set the persistence context to use when building the object graph from the JSON.
    • getPersistenceContext

      public PersistenceContext getPersistenceContext()
      Return the persistence context to use when marshalling JSON.
    • getLoadContext

      public Object getLoadContext()
      Return the load context to use.
    • setLoadContext

      public void setLoadContext(Object loadContext)
      Set the load context to use.