From 328dd54a476dc947413f35ba5e0de8c55602c5b4 Mon Sep 17 00:00:00 2001 From: Thomas Lenz Date: Wed, 17 Jul 2019 13:44:51 +0200 Subject: update JSON mapper implementation --- .../at/gv/egiz/eaaf/core/api/utils/IJsonMapper.java | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'eaaf_core/src/main/java/at/gv/egiz/eaaf/core/api/utils/IJsonMapper.java') diff --git a/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/api/utils/IJsonMapper.java b/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/api/utils/IJsonMapper.java index 10e6464b..6db5a6ae 100644 --- a/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/api/utils/IJsonMapper.java +++ b/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/api/utils/IJsonMapper.java @@ -1,12 +1,12 @@ package at.gv.egiz.eaaf.core.api.utils; import java.io.IOException; +import java.io.InputStream; import at.gv.egiz.eaaf.core.exceptions.EAAFJsonMapperException; public interface IJsonMapper { - - + /** * Serialize an object to a JSON string. * @param value the object to serialize @@ -27,6 +27,16 @@ public interface IJsonMapper { */ Object deserialize(String value, Class clazz) throws EAAFJsonMapperException; - // Object deserialize(String value, TypeReference clazz) throws EAAFJsonMapperException; - + /** + * Deserialize a JSON string. + * + * @param is the JSON to deserialize as {@link InputStream} + * @param clazz optional parameter that determines the type of the returned object. If not set, an {@link Object} is returned. + * @return the deserialized JSON string as an object of type {@code clazz} or {@link Object} + * @throws JsonParseException if the JSON string contains invalid content. + * @throws JsonMappingException if the input JSON structure does not match structure expected for result type + * @throws IOException if an I/O problem occurs (e.g. unexpected end-of-input) + */ + Object deserialize(InputStream is, Class clazz) throws EAAFJsonMapperException; + } \ No newline at end of file -- cgit v1.2.3