Class JacksonPropertyAccessor
java.lang.Object
org.springframework.integration.json.JacksonPropertyAccessor
- All Implemented Interfaces:
PropertyAccessor,TargetedAccessor
A SpEL
PropertyAccessor that knows how to read properties from JSON objects.
Uses Jackson JsonNode API for nested properties access.
- Since:
- 7.0
- Author:
- Jooyoung Pyoung, Artem Bilan
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancanRead(EvaluationContext context, @Nullable Object target, String name) booleancanWrite(EvaluationContext context, @Nullable Object target, String name) Class<?>[]read(EvaluationContext context, @Nullable Object target, String name) voidsetObjectMapper(tools.jackson.databind.json.JsonMapper jsonMapper) static @Nullable Objectwrap(@Nullable tools.jackson.databind.JsonNode json) voidwrite(EvaluationContext context, @Nullable Object target, String name, @Nullable Object newValue)
-
Constructor Details
-
JacksonPropertyAccessor
public JacksonPropertyAccessor()
-
-
Method Details
-
setObjectMapper
public void setObjectMapper(tools.jackson.databind.json.JsonMapper jsonMapper) -
getSpecificTargetClasses
- Specified by:
getSpecificTargetClassesin interfaceTargetedAccessor
-
canRead
public boolean canRead(EvaluationContext context, @Nullable Object target, String name) throws AccessException - Specified by:
canReadin interfacePropertyAccessor- Throws:
AccessException
-
read
public TypedValue read(EvaluationContext context, @Nullable Object target, String name) throws AccessException - Specified by:
readin interfacePropertyAccessor- Throws:
AccessException
-
canWrite
- Specified by:
canWritein interfacePropertyAccessor
-
write
public void write(EvaluationContext context, @Nullable Object target, String name, @Nullable Object newValue) - Specified by:
writein interfacePropertyAccessor
-
wrap
public static @Nullable Object wrap(@Nullable tools.jackson.databind.JsonNode json) throws AccessException - Throws:
AccessException
-