Skip to content

Commit

Permalink
Add throws javadoc tag for TypeAdapter methods
Browse files Browse the repository at this point in the history
  • Loading branch information
Marcono1234 committed Aug 7, 2022
1 parent 399c524 commit a034e73
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions gson/src/main/java/com/google/gson/TypeAdapter.java
Expand Up @@ -131,7 +131,7 @@ public abstract class TypeAdapter<T> {
* Unlike Gson's similar {@link Gson#toJson(JsonElement, Appendable) toJson}
* method, this write is strict. Create a {@link
* JsonWriter#setLenient(boolean) lenient} {@code JsonWriter} and call
* {@link #write(com.google.gson.stream.JsonWriter, Object)} for lenient
* {@link #write(JsonWriter, Object)} for lenient
* writing.
*
* @param value the Java object to convert. May be null.
Expand Down Expand Up @@ -205,9 +205,9 @@ public final TypeAdapter<T> nullSafe() {
* Converts {@code value} to a JSON document. Unlike Gson's similar {@link
* Gson#toJson(Object) toJson} method, this write is strict. Create a {@link
* JsonWriter#setLenient(boolean) lenient} {@code JsonWriter} and call
* {@link #write(com.google.gson.stream.JsonWriter, Object)} for lenient
* writing.
* {@link #write(JsonWriter, Object)} for lenient writing.
*
* @throws JsonIOException wrapping {@code IOException}s thrown by {@link #write(JsonWriter, Object)}
* @param value the Java object to convert. May be null.
* @since 2.2
*/
Expand All @@ -226,6 +226,7 @@ public final String toJson(T value) {
*
* @param value the Java object to convert. May be null.
* @return the converted JSON tree. May be {@link JsonNull}.
* @throws JsonIOException wrapping {@code IOException}s thrown by {@link #write(JsonWriter, Object)}
* @since 2.2
*/
public final JsonElement toJsonTree(T value) {
Expand All @@ -248,7 +249,7 @@ public final JsonElement toJsonTree(T value) {

/**
* Converts the JSON document in {@code in} to a Java object. Unlike Gson's
* similar {@link Gson#fromJson(java.io.Reader, Class) fromJson} method, this
* similar {@link Gson#fromJson(Reader, Class) fromJson} method, this
* read is strict. Create a {@link JsonReader#setLenient(boolean) lenient}
* {@code JsonReader} and call {@link #read(JsonReader)} for lenient reading.
*
Expand Down Expand Up @@ -284,6 +285,7 @@ public final T fromJson(String json) throws IOException {
*
* @param jsonTree the JSON element to convert. May be {@link JsonNull}.
* @return the converted Java object. May be null.
* @throws JsonIOException wrapping {@code IOException}s thrown by {@link #read(JsonReader)}
* @since 2.2
*/
public final T fromJsonTree(JsonElement jsonTree) {
Expand Down

0 comments on commit a034e73

Please sign in to comment.