Package io.ebean.text.json
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.
-
-
Constructor Summary
Constructors Constructor Description JsonReadOptions()
Default constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description JsonReadOptions
addRootVisitor(JsonReadBeanVisitor<?> visitor)
Register a JsonReadBeanVisitor for the root level.JsonReadOptions
addVisitor(String path, JsonReadBeanVisitor<?> visitor)
Register a JsonReadBeanVisitor for a given path.Object
getLoadContext()
Return the load context to use.Object
getObjectMapper()
Return the Jackson ObjectMapper to use (if not wanted to use the objectMapper set on the DatabaseConfig).PersistenceContext
getPersistenceContext()
Return the persistence context to use when marshalling JSON.Map<String,JsonReadBeanVisitor<?>>
getVisitorMap()
Return the map of JsonReadBeanVisitor's.boolean
isEnableLazyLoading()
Return true if lazy loading is enabled after the objects are loaded.JsonReadOptions
setEnableLazyLoading(boolean enableLazyLoading)
Set to true to enable lazy loading on partially populated beans.void
setLoadContext(Object loadContext)
Set the load context to use.JsonReadOptions
setObjectMapper(Object objectMapper)
Set the Jackson ObjectMapper to use (if not wanted to use the objectMapper set on the DatabaseConfig).JsonReadOptions
setPersistenceContext(PersistenceContext persistenceContext)
Set the persistence context to use when building the object graph from the JSON.
-
-
-
Constructor Detail
-
JsonReadOptions
public JsonReadOptions()
Default constructor.
-
-
Method Detail
-
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.
-
-