public interface JsonDelivery
Modifier and Type | Method and Description |
---|---|
com.google.gson.JsonElement |
getData() |
<T> T |
getData(Class<T> classOfT)
Deserializes the JSON data into an object of the specified class.
|
<T> T |
getData(Type typeOfT)
Deserializes the JSON data into an object of the specified type.
|
String |
getRawData() |
<T> T getData(Class<T> classOfT) throws com.google.gson.JsonSyntaxException
getData(Type)
method instead if the class is of a generic type. This is equivalent to calling Gson.fromJson(String, Type)
.classOfT
- the class for the desired object.null
if the JSON is a representation of null).com.google.gson.JsonSyntaxException
- if the JSON data cannot be deserialized into an object of type classOfT
.<T> T getData(Type typeOfT) throws com.google.gson.JsonSyntaxException
getData(Class)
method instead if the class is not of a generic type. This is equivalent to calling Gson.fromJson(String, Type)
.typeOfT
- the type for the desired object.null
if the JSON is a representation of null).com.google.gson.JsonSyntaxException
- if the JSON data cannot be deserialized into an object of type typeOfT
.com.google.gson.JsonElement getData() throws com.google.gson.JsonParseException
JsonElement
representing the deserialized JSON data. This is equivalent to calling JsonParser.parse(String)
.com.google.gson.JsonParseException
- if the data is not valid JSON.com.google.gson.JsonSyntaxException
- if the data contains malformed JSON elements.String getRawData()
String
representation of the JSON. This allows other parsers to be used.Copyright © 2015 International Business Machines Corporation. All rights reserved.