public interface JsonDeserializer
During the deserialization the JSON name of the fields will be the same as in java.
To change that, you can use SerializedName annotation on the java field.
| Modifier and Type | Method and Description |
|---|---|
<T> T |
fromJson(Reader json,
Type typeOfT)
This method deserializes the JSON read from the specified reader into an object of the specified type.
|
<T> T |
fromJson(String json,
Type typeOfT)
This method deserializes the specified JSON into an object of the specified type.
|
<T> List<T> |
fromJsonToList(Reader json,
Class<T> typeOfT)
This method deserializes the specified JSON into a list of objects of the specified type.
|
<T> List<T> |
fromJsonToList(String json,
Class<T> typeOfT)
This method deserializes the specified JSON into a list of objects of the specified type.
|
<T> T fromJson(String json, Type typeOfT) throws TransformerException
JAXBElement.
If you have the Json in a Reader instead of a String, use fromJson(Reader, Type) instead.T - the type of the desired objectjson - the string from which the object is to be deserializedtypeOfT - the specific genericized type of jsonnull if json is null.TransformerException - if json is not a valid representation for an object of type typeOfT<T> T fromJson(Reader json, Type typeOfT) throws TransformerException
JAXBElement.
If you have the JSON in a String form instead of a Reader, use fromJson(String, Type) instead.T - the type of the desired objectjson - the reader producing Json from which the object is to be deserializedtypeOfT - the specific genericized type of jsonnull if json is null.TransformerException - if json is not a valid representation for an object of type typeOfT<T> List<T> fromJsonToList(String json, Class<T> typeOfT) throws TransformerException
JAXBElement.
If you have the Json in a Reader instead of a String, use fromJsonToList(Reader, Class) instead.T - the type of the desired objectsjson - the string from which the object is to be deserializedtypeOfT - the type of the desired objectsnull if json is null.TransformerException - if json is not a valid representation for an object of type typeOfT<T> List<T> fromJsonToList(Reader json, Class<T> typeOfT) throws TransformerException
JAXBElement.
If you have the JSON in a String form instead of a Reader, use fromJsonToList(String, Class) instead.T - the type of the desired objectsjson - the string from which the object is to be deserializedtypeOfT - the type of the desired objectsnull if json is null.TransformerException - if json is not a valid representation for an object of type typeOfTCreated by Kornél Simon, 2022