java.lang.Object
io.ebeaninternal.server.json.ReadJson
- All Implemented Interfaces:
SpiJsonReader
Context for JSON read processing.
-
Constructor Summary
ConstructorsConstructorDescriptionReadJson(BeanDescriptor<?> desc, com.fasterxml.jackson.core.JsonParser parser, JsonReadOptions readOptions, Object objectMapper, boolean update) Construct with parser and readOptions. -
Method Summary
Modifier and TypeMethodDescriptionvoidbeanVisitor(Object bean, Map<String, Object> unmappedProperties) If there is a JsonReadBeanVisitor registered to the current path then call it's visit method with the bean and unmappedProperties.forJson(com.fasterxml.jackson.core.JsonParser moreJson) Return a new instance of ReadJson using the existing context but with a new JsonParser.com.fasterxml.jackson.databind.ObjectMappermapper()Return the objectMapper used for this request.com.fasterxml.jackson.core.JsonTokenReturn the next JsonToken from the underlying parser.com.fasterxml.jackson.core.JsonParserparser()Return the JsonParser.Return the persistence context being used if any.<T> voidpersistenceContextPut(Object beanId, T currentBean) Add the bean to the persistence context.persistenceContextPutIfAbsent(Object id, EntityBean bean, BeanDescriptor<?> beanDesc) Put the bean into the persistence context.voidpopPath()Pop the path stack.voidPush the path onto the stack (traversing a 1-M or M-1 etc)readValueUsingObjectMapper(Class<?> propertyType) Read the property value using Jackson ObjectMapper.booleanupdate()Do we update an existing bean?
-
Constructor Details
-
ReadJson
public ReadJson(BeanDescriptor<?> desc, com.fasterxml.jackson.core.JsonParser parser, JsonReadOptions readOptions, Object objectMapper, boolean update) Construct with parser and readOptions.
-
-
Method Details
-
persistenceContext
Return the persistence context being used if any.- Specified by:
persistenceContextin interfaceSpiJsonReader
-
forJson
Return a new instance of ReadJson using the existing context but with a new JsonParser.- Specified by:
forJsonin interfaceSpiJsonReader
-
persistenceContextPut
Add the bean to the persistence context.- Specified by:
persistenceContextPutin interfaceSpiJsonReader
-
persistenceContextPutIfAbsent
Put the bean into the persistence context. If there is already a matching bean in the persistence context then return that instance else return null.- Specified by:
persistenceContextPutIfAbsentin interfaceSpiJsonReader
-
mapper
public com.fasterxml.jackson.databind.ObjectMapper mapper()Return the objectMapper used for this request.- Specified by:
mapperin interfaceSpiJsonReader
-
parser
public com.fasterxml.jackson.core.JsonParser parser()Return the JsonParser.- Specified by:
parserin interfaceSpiJsonReader
-
nextToken
Return the next JsonToken from the underlying parser.- Specified by:
nextTokenin interfaceSpiJsonReader- Throws:
IOException
-
pushPath
Push the path onto the stack (traversing a 1-M or M-1 etc)- Specified by:
pushPathin interfaceSpiJsonReader
-
popPath
public void popPath()Pop the path stack.- Specified by:
popPathin interfaceSpiJsonReader
-
beanVisitor
If there is a JsonReadBeanVisitor registered to the current path then call it's visit method with the bean and unmappedProperties.- Specified by:
beanVisitorin interfaceSpiJsonReader
-
readValueUsingObjectMapper
Read the property value using Jackson ObjectMapper. Typically this is used to read Transient properties where the type is unknown to Ebean.- Specified by:
readValueUsingObjectMapperin interfaceSpiJsonReader- Throws:
IOException
-
update
public boolean update()Do we update an existing bean? This meeans we have to set values via intercept and handle collections.- Specified by:
updatein interfaceSpiJsonReader
-