diff options
author | Thomas Lenz <thomas.lenz@egiz.gv.at> | 2019-06-28 09:25:09 +0200 |
---|---|---|
committer | Thomas Lenz <thomas.lenz@egiz.gv.at> | 2019-06-28 09:25:09 +0200 |
commit | 514747e925abddcb320a8433908dbae32dc5049b (patch) | |
tree | 9bdcd47fe8ca13c27321739077d078fad5da43b8 /eaaf_core/src/main/java/at/gv/egiz/eaaf/core/api/utils | |
parent | 470ac2c6234a0bac1e973fd3c1f49e1d9da41be4 (diff) | |
download | EAAF-Components-514747e925abddcb320a8433908dbae32dc5049b.tar.gz EAAF-Components-514747e925abddcb320a8433908dbae32dc5049b.tar.bz2 EAAF-Components-514747e925abddcb320a8433908dbae32dc5049b.zip |
some small updates
Diffstat (limited to 'eaaf_core/src/main/java/at/gv/egiz/eaaf/core/api/utils')
-rw-r--r-- | eaaf_core/src/main/java/at/gv/egiz/eaaf/core/api/utils/IJsonMapper.java | 32 |
1 files changed, 32 insertions, 0 deletions
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 new file mode 100644 index 00000000..10e6464b --- /dev/null +++ b/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/api/utils/IJsonMapper.java @@ -0,0 +1,32 @@ +package at.gv.egiz.eaaf.core.api.utils; + +import java.io.IOException; + +import at.gv.egiz.eaaf.core.exceptions.EAAFJsonMapperException; + +public interface IJsonMapper { + + + /** + * Serialize an object to a JSON string. + * @param value the object to serialize + * @return a JSON string + * @throws JsonProcessingException thrown when an error occurs during serialization + */ + String serialize(Object value) throws EAAFJsonMapperException; + + /** + * Deserialize a JSON string. + * + * @param value the JSON string to deserialize + * @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) + */ + <T> Object deserialize(String value, Class<T> clazz) throws EAAFJsonMapperException; + + //<T> Object deserialize(String value, TypeReference<T> clazz) throws EAAFJsonMapperException; + +}
\ No newline at end of file |