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 TypeMethodDescriptionboolean
canRead
(EvaluationContext context, @Nullable Object target, String name) boolean
canWrite
(EvaluationContext context, @Nullable Object target, String name) Class<?>[]
read
(EvaluationContext context, @Nullable Object target, String name) void
setObjectMapper
(tools.jackson.databind.json.JsonMapper jsonMapper) static @Nullable Object
wrap
(@Nullable tools.jackson.databind.JsonNode json) void
write
(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:
getSpecificTargetClasses
in interfaceTargetedAccessor
-
canRead
public boolean canRead(EvaluationContext context, @Nullable Object target, String name) throws AccessException - Specified by:
canRead
in interfacePropertyAccessor
- Throws:
AccessException
-
read
public TypedValue read(EvaluationContext context, @Nullable Object target, String name) throws AccessException - Specified by:
read
in interfacePropertyAccessor
- Throws:
AccessException
-
canWrite
- Specified by:
canWrite
in interfacePropertyAccessor
-
write
public void write(EvaluationContext context, @Nullable Object target, String name, @Nullable Object newValue) - Specified by:
write
in interfacePropertyAccessor
-
wrap
public static @Nullable Object wrap(@Nullable tools.jackson.databind.JsonNode json) throws AccessException - Throws:
AccessException
-