| Constructor and Description |
|---|
JsonUtilImpl()
Default constructor
|
| Modifier and Type | Method and Description |
|---|---|
<T> T |
deserialise(InputStream is,
Class<T> class1)
Deserialise an input stream representation of a JSON document to the named class
|
<T> T |
deserialise(String is,
Class<T> class1)
Deserialise a string representation of a JSON document to the named class
|
com.google.gson.Gson |
getGson() |
<T> String |
serialise(T object)
Serialise an object to a JSON string
|
public <T> T deserialise(InputStream is, Class<T> class1) throws JsonSerialisationException
JsonUtildeserialise in interface JsonUtilT - Class to deserialise tois - The input stream to deserialiseclass1 - The class to which is should be deserialisedJsonSerialisationException - If something goes horribly wrong in deserialisationJsonUtil.deserialise(java.io.InputStream, java.lang.Class)public <T> T deserialise(String is, Class<T> class1) throws JsonSerialisationException
JsonUtildeserialise in interface JsonUtilT - Class to deserialise tois - The input string to deserialiseclass1 - The class to which the input should be deserialisedJsonSerialisationException - If something goes horribly wrong in deserialisationJsonUtil.deserialise(java.lang.String, java.lang.Class)public com.google.gson.Gson getGson()
public <T> String serialise(T object) throws JsonSerialisationException
JsonUtilserialise in interface JsonUtilT - Class to serialiseobject - The object to be serialisedJsonSerialisationException - If something goes horribly wrong in serialisationJsonUtil.serialise(Object)Copyright © 2016 Dan Shannon. All rights reserved.