yangjm/winlet · JsonUtils.java
java logo
public static <T> T fromJSON(final TypeReference<T> type,
			final String jsonPacket) throws JsonParseException,
			JsonMappingException, IOException {
		T data = null;

		data = new ObjectMapper().readValue(jsonPacket, type);
		return data;
	}
Similar code snippets
1.
OpenCompare/OpenCompare · JsonBestBuyProductRepositoryImpl.java
Match rating: 77.44% · See similar code snippets
java logo
private static <T> T fromJSON(TypeReference<T> type, String jsonPacket) {
        T data = null;
        try {
            data = new ObjectMapper().readValue(jsonPacket, type);
        } catch (Exception ex) {
            ex.printStackTrace();
        }
        return data;
    }
2.
signalapp/libsignal-service-java · JsonUtil.java
Match rating: 65.5% · See similar code snippets
java logo
public static <T> T fromJson(String json, Class<T> clazz)
      throws IOException
  {
    return objectMapper.readValue(json, clazz);
  }
3.
pip-services3-java/pip-services3-commons-java · JsonConverter.java
Match rating: 65.21% · See similar code snippets
java logo
public static <T> T fromJson(Class<T> type, String value)
			throws JsonMappingException, JsonParseException, IOException {
		if (value == null)
			return null;
		return _mapper.readValue(value, type);
	}
4.
meraki-analytics/orianna · DataObject.java
Match rating: 63.81% · See similar code snippets
java logo
public static <T extends DataObject> T fromJSON(final Class<T> type, final String json) {
        return fromJSON(type, null, json);
    }
5.
GetStream/stream-java · Serialization.java
Match rating: 62.85% · See similar code snippets
java logo
public static <T> T fromJSON(InputStream json, Class<T> type) throws IOException {
        return mapper.readValue(json, type);
    }
6.
EsotericSoftware/jsonbeans · Json.java
Match rating: 62.71% · See similar code snippets
java logo
public <T> T readValue (Class<T> type, JsonValue jsonData) {
		return (T)readValue(type, null, jsonData);
	}
7.
apache/parquet-mr · SummaryData.java
Match rating: 62.57% · See similar code snippets
java logo
public static <T extends SummaryData> T fromJSON(String json, Class<T> clazz) {
    try {
      return objectMapper.readValue(new StringReader(json), clazz);
    } catch (JsonParseException e) {
      throw new RuntimeException(e);
    } catch (JsonMappingException e) {
      throw new RuntimeException(e);
    } catch (IOException e) {
      throw new RuntimeException(e);
    }
  }
8.
deeplearning4j/deeplearning4j · JsonMapper.java
Match rating: 61.86% · See similar code snippets
java logo
public static <T> T fromJson(String json, Class<? extends T> type){
        try{
            return getMapper().readValue(json, type);
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }
9.
l0rdn1kk0n/wicket-jquery-selectors · Json.java
Match rating: 61.33% · See similar code snippets
java logo
public static <T> T fromJson(final String json, final Class<T> clazz) {
        return fromJson(parse(json), clazz);
    }
10.
Multifarious/MacroManager · JsonUtil.java
Match rating: 60.08% · See similar code snippets
java logo
public static <T> T fromJSON(String json, Class<T> cls) throws IOException {
        return MAPPER.readValue(json, cls);
    }