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