public class JsonPropertyAccessor extends Object implements PropertyAccessor
PropertyAccessor
that knows how to read properties from JSON objects.
Uses Jackson JsonNode
API for nested properties access.Modifier and Type | Class and Description |
---|---|
static class |
JsonPropertyAccessor.ArrayNodeAsList
|
static class |
JsonPropertyAccessor.ToStringFriendlyJsonNode
A
JsonPropertyAccessor.WrappedJsonNode implementation to represent JsonNode as string. |
static interface |
JsonPropertyAccessor.WrappedJsonNode<T extends com.fasterxml.jackson.databind.JsonNode>
The base interface for wrapped
JsonNode . |
Constructor and Description |
---|
JsonPropertyAccessor() |
Modifier and Type | Method and Description |
---|---|
boolean |
canRead(EvaluationContext context,
Object target,
String name) |
boolean |
canWrite(EvaluationContext context,
Object target,
String name) |
Class<?>[] |
getSpecificTargetClasses() |
TypedValue |
read(EvaluationContext context,
Object target,
String name) |
void |
setObjectMapper(com.fasterxml.jackson.databind.ObjectMapper objectMapper) |
static JsonPropertyAccessor.WrappedJsonNode<?> |
wrap(com.fasterxml.jackson.databind.JsonNode json) |
void |
write(EvaluationContext context,
Object target,
String name,
Object newValue) |
public void setObjectMapper(com.fasterxml.jackson.databind.ObjectMapper objectMapper)
public Class<?>[] getSpecificTargetClasses()
getSpecificTargetClasses
in interface PropertyAccessor
public boolean canRead(EvaluationContext context, Object target, String name) throws AccessException
canRead
in interface PropertyAccessor
AccessException
public TypedValue read(EvaluationContext context, Object target, String name) throws AccessException
read
in interface PropertyAccessor
AccessException
public boolean canWrite(EvaluationContext context, Object target, String name)
canWrite
in interface PropertyAccessor
public void write(EvaluationContext context, Object target, String name, Object newValue)
write
in interface PropertyAccessor
public static JsonPropertyAccessor.WrappedJsonNode<?> wrap(com.fasterxml.jackson.databind.JsonNode json)