MCPcopy
hub / github.com/google/gson / fromJson

Method fromJson

gson/src/main/java/com/google/gson/Gson.java:827–829  ·  gson/src/main/java/com/google/gson/Gson.java::Gson.fromJson

This method deserializes the specified JSON into an object of the specified class. It is not suitable to use if the specified class is a generic type since it will not have the generic type information because of the Type Erasure feature of Java. Therefore, this method should not be used if the desi

(String json, Class<T> classOfT)

Source from the content-addressed store, hash-verified

825 * @see #fromJson(String, TypeToken)
826 */
827 public <T> T fromJson(String json, Class<T> classOfT) throws JsonSyntaxException {
828 return fromJson(json, TypeToken.get(classOfT));
829 }
830
831 /**
832 * This method deserializes the specified JSON into an object of the specified type. This method

Callers 15

customStringAdapterMethod · 0.95
testDeserializationMethod · 0.95
testDeserializationMethod · 0.95
testInstanceCreatorMethod · 0.95
testFinalFieldMethod · 0.95
testSerializedNameMethod · 0.95
testCustomAdapterMethod · 0.95

Calls 10

getMethod · 0.95
newJsonReaderMethod · 0.95
assertFullConsumptionMethod · 0.95
getAdapterMethod · 0.95
wrapMethod · 0.95
getStrictnessMethod · 0.45
setStrictnessMethod · 0.45
peekMethod · 0.45
readMethod · 0.45
getRawTypeMethod · 0.45

Tested by 15

customStringAdapterMethod · 0.76
testDeserializationMethod · 0.76
testDeserializationMethod · 0.76
testInstanceCreatorMethod · 0.76
testFinalFieldMethod · 0.76
testSerializedNameMethod · 0.76
testCustomAdapterMethod · 0.76