Code example for Gson

Methods: fromJson

0
		String str = i18nStr;
		if (i18nStr != null && i18nStr.startsWith("{") && i18nStr.endsWith("}"))
		{ 
			try 
			{ 
				Map<String, String> i18nMap = new Gson().fromJson(i18nStr, new TypeToken<Map<String, String>>()
				{ 
				}.getType());
				str = i18nMap.get(lang);
			} 
			catch (JsonParseException e)
			{ 
				logger.warn(e);
				str = i18nStr;
			} 
		} 
		return str;
	} 
} 
Contextual code suggestions in your IDE  Get Codota for Java