Interface JsonObjectMapper<N,P>
- Type Parameters:
N
- - The expected type of JSON Node.P
- - The expected type of JSON Parser.
- All Known Implementing Classes:
AbstractJacksonJsonObjectMapper
,Jackson2JsonObjectMapper
public interface JsonObjectMapper<N,P>
Strategy interface to convert an Object to/from the JSON representation.
- Since:
- 3.0
- Author:
- Artem Bilan
-
Method Summary
Modifier and Type Method Description default <T> T
fromJson(Object json, Class<T> valueType)
default <T> T
fromJson(Object json, Map<String,Object> javaTypes)
default <T> T
fromJson(Object json, ResolvableType valueType)
Deserialize a JSON to an expectedResolvableType
.default <T> T
fromJson(P parser, Type valueType)
default void
populateJavaTypes(Map<String,Object> map, Object object)
default String
toJson(Object value)
default void
toJson(Object value, Writer writer)
default N
toJsonNode(Object value)
-
Method Details
-
toJson
- Throws:
IOException
-
toJson
- Throws:
IOException
-
toJsonNode
- Throws:
IOException
-
fromJson
- Throws:
IOException
-
fromJson
Deserialize a JSON to an expectedResolvableType
.- Type Parameters:
T
- the expected object type- Parameters:
json
- the JSON to deserializevalueType
- theResolvableType
for the target object.- Returns:
- deserialization result object
- Throws:
IOException
- a JSON parsing exception- Since:
- 5.2
-
fromJson
- Throws:
IOException
-
fromJson
- Throws:
IOException
-
populateJavaTypes
-