Experimental: bean can be used as JSON target

This commit is contained in:
Roland Praml committed 2022-02-02 09:00:15 +01:00
1 parent 4251383ab8
commit 66c8008ddb
11 files changed
+132 -29

No files matched your search

@@ -15,8 +15,12 @@ public interface JsonBeanReader<T> {
/**
* Read the JSON returning a bean.
*/
T read();
T read(T target);
default T read() {
return read(null);
}
/**
* Create a new reader taking the context from the existing one but using a new JsonParser.
*/
@@ -58,6 +58,48 @@ public interface JsonContext {
*/
<T> T toBean(Class<T> cls, JsonParser parser, JsonReadOptions options) throws JsonIOException;
/**
* Convert json parser input into a Bean of a specific type.
*
* @throws JsonIOException When IOException occurs
*/
<T> void toBean(T target, JsonParser parser) throws JsonIOException;
/**
* Convert json parser input into a Bean of a specific type additionally using JsonReadOptions..
*
* @throws JsonIOException When IOException occurs
*/
<T> void toBean(T target, JsonParser parser, JsonReadOptions options) throws JsonIOException;
/**
* Convert json reader input into a Bean of a specific type.
*
* @throws JsonIOException When IOException occurs
*/
<T> void toBean(T target, Reader json) throws JsonIOException;
/**
* Convert json reader input into a Bean of a specific type additionally using JsonReadOptions.
*
* @throws JsonIOException When IOException occurs
*/
<T> void toBean(T target, Reader json, JsonReadOptions options) throws JsonIOException;
/**
* Convert json string input into a Bean of a specific type.
*
* @throws JsonIOException When IOException occurs
*/
<T> void toBean(T target, String json) throws JsonIOException;
/**
* Convert json string input into a Bean of a specific type additionally using JsonReadOptions.
*
* @throws JsonIOException When IOException occurs
*/
<T> void toBean(T target, String json, JsonReadOptions options) throws JsonIOException;
/**
* Create and return a new bean reading for the bean type given the JSON options and source.
* <p>