Code example for Gson

Methods: fromJson

0
				if (typeOfT != null)
				{ 
					return this.gson.fromJson(jsonStr, typeOfT);
				} 
 
				return this.gson.fromJson(jsonStr, clazz);
			} 
			else 
			{ 
				if (typeOfT != null)
				{ 
					return this.gson.fromJson(json, typeOfT);
				} 
 
				return this.gson.fromJson(json, clazz);
			} 
		} 
		catch (JsonSyntaxException ex)
		{ 
			throw new HttpMessageNotReadableException("Could not read JSON: " + ex.getMessage(), ex);