public class JsonReadOptions extends Object
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 and Description |
---|
JsonReadOptions()
Default constructor.
|
Modifier and Type | Method and 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 ServerConfig).
|
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 ServerConfig).
|
JsonReadOptions |
setPersistenceContext(PersistenceContext persistenceContext)
Set the persistence context to use when building the object graph from the JSON.
|
public JsonReadOptions()
public Map<String,JsonReadBeanVisitor<?>> getVisitorMap()
public JsonReadOptions addRootVisitor(JsonReadBeanVisitor<?> visitor)
public JsonReadOptions addVisitor(String path, JsonReadBeanVisitor<?> visitor)
public boolean isEnableLazyLoading()
public JsonReadOptions setEnableLazyLoading(boolean enableLazyLoading)
If this is set to true a persistence context will be created if one has not already been supplied.
public Object getObjectMapper()
public JsonReadOptions setObjectMapper(Object objectMapper)
public JsonReadOptions setPersistenceContext(PersistenceContext persistenceContext)
public PersistenceContext getPersistenceContext()
public Object getLoadContext()
public void setLoadContext(Object loadContext)
Copyright © 2019. All rights reserved.