@@ -829,6 +829,9 @@ public void toJson(JsonElement jsonElement, JsonWriter writer) throws JsonIOExce
829
829
* {@link #fromJson(String, Type)}. If you have the JSON in a {@link Reader} instead of
830
830
* a String, use {@link #fromJson(Reader, Class)} instead.
831
831
*
832
+ * <p>This method tries to fully consume the JSON and throws an exception in case that is not
833
+ * possible. Use {@link #fromJson(JsonReader, Class)} if this behavior is not desired.
834
+ *
832
835
* @param <T> the type of the desired object
833
836
* @param json the string from which the object is to be deserialized
834
837
* @param classOfT the class of T
@@ -857,6 +860,9 @@ public <T> T fromJson(String json, Class<T> classOfT) throws JsonSyntaxException
857
860
* <p>If you are creating the {@code Type} from a {@link TypeToken}, prefer using
858
861
* {@link #fromJson(String, TypeToken)} instead since its return type is based on the
859
862
* {@code TypeToken} and is therefore more type-safe.
863
+ *
864
+ * <p>This method tries to fully consume the JSON and throws an exception in case that is not
865
+ * possible. Use {@link #fromJson(JsonReader, Type)} if this behavior is not desired.
860
866
*
861
867
* @param <T> the type of the desired object
862
868
* @param json the string from which the object is to be deserialized
@@ -885,6 +891,9 @@ public <T> T fromJson(String json, Type typeOfT) throws JsonSyntaxException {
885
891
* {@link #fromJson(String, Class)} instead. If you have the JSON in a {@link Reader} instead of
886
892
* a String, use {@link #fromJson(Reader, TypeToken)} instead.
887
893
*
894
+ * <p>This method tries to fully consume the JSON and throws an exception in case that is not
895
+ * possible. Use {@link #fromJson(JsonReader, TypeToken)} if this behavior is not desired.
896
+ *
888
897
* @param <T> the type of the desired object
889
898
* @param json the string from which the object is to be deserialized
890
899
* @param typeOfT The specific genericized type of src. You should create an anonymous subclass of
@@ -914,6 +923,9 @@ public <T> T fromJson(String json, TypeToken<T> typeOfT) throws JsonSyntaxExcept
914
923
* object itself should not be a generic type. For the cases when the object is of generic type,
915
924
* invoke {@link #fromJson(Reader, Type)}. If you have the JSON in a String form instead of a
916
925
* {@link Reader}, use {@link #fromJson(String, Class)} instead.
926
+ *
927
+ * <p>This method tries to fully consume the JSON and throws an exception in case that is not
928
+ * possible. Use {@link #fromJson(JsonReader, Class)} if this behavior is not desired.
917
929
*
918
930
* @param <T> the type of the desired object
919
931
* @param json the reader producing the JSON from which the object is to be deserialized.
@@ -945,6 +957,9 @@ public <T> T fromJson(Reader json, Class<T> classOfT) throws JsonSyntaxException
945
957
* <p>If you are creating the {@code Type} from a {@link TypeToken}, prefer using
946
958
* {@link #fromJson(Reader, TypeToken)} instead since its return type is based on the
947
959
* {@code TypeToken} and is therefore more type-safe.
960
+ *
961
+ * <p>This method tries to fully consume the JSON and throws an exception in case that is not
962
+ * possible. Use {@link #fromJson(JsonReader, Type)} if this behavior is not desired.
948
963
*
949
964
* @param <T> the type of the desired object
950
965
* @param json the reader producing JSON from which the object is to be deserialized
@@ -971,6 +986,9 @@ public <T> T fromJson(Reader json, Type typeOfT) throws JsonIOException, JsonSyn
971
986
* specified type. This method is useful if the specified object is a generic type. For
972
987
* non-generic objects, use {@link #fromJson(Reader, Class)} instead. If you have the JSON in a
973
988
* String form instead of a {@link Reader}, use {@link #fromJson(String, TypeToken)} instead.
989
+ *
990
+ * <p>This method tries to fully consume the JSON and throws an exception in case that is not
991
+ * possible. Use {@link #fromJson(JsonReader, TypeToken)} if this behavior is not desired.
974
992
*
975
993
* @param <T> the type of the desired object
976
994
* @param json the reader producing JSON from which the object is to be deserialized
0 commit comments