Update adapter methods ISE message. (#273)

This commit is contained in:
Eric Cochran
2017-03-27 16:25:31 -07:00
committed by Jesse Wilson
parent 05b0a46961
commit 1b634bbb74
2 changed files with 10 additions and 2 deletions

View File

@@ -186,6 +186,8 @@ final class AdapterMethodsFactory implements JsonAdapter.Factory {
throw new IllegalArgumentException("Unexpected signature for " + method + ".\n" throw new IllegalArgumentException("Unexpected signature for " + method + ".\n"
+ "@ToJson method signatures may have one of the following structures:\n" + "@ToJson method signatures may have one of the following structures:\n"
+ " <any access modifier> void toJson(JsonWriter writer, T value) throws <any>;\n" + " <any access modifier> void toJson(JsonWriter writer, T value) throws <any>;\n"
+ " <any access modifier> void toJson(JsonReader jsonReader,"
+ " JsonAdapter<any> delegate, <any more delegates>) throws <any>;\n"
+ " <any access modifier> R toJson(T value) throws <any>;\n"); + " <any access modifier> R toJson(T value) throws <any>;\n");
} }
} }
@@ -248,7 +250,9 @@ final class AdapterMethodsFactory implements JsonAdapter.Factory {
} else { } else {
throw new IllegalArgumentException("Unexpected signature for " + method + ".\n" throw new IllegalArgumentException("Unexpected signature for " + method + ".\n"
+ "@FromJson method signatures may have one of the following structures:\n" + "@FromJson method signatures may have one of the following structures:\n"
+ " <any access modifier> void fromJson(JsonReader jsonReader) throws <any>;\n" + " <any access modifier> R fromJson(JsonReader jsonReader) throws <any>;\n"
+ " <any access modifier> R fromJson(JsonReader jsonReader,"
+ " JsonAdapter<any> delegate, <any more delegates>) throws <any>;\n"
+ " <any access modifier> R fromJson(T value) throws <any>;\n"); + " <any access modifier> R fromJson(T value) throws <any>;\n");
} }
} }

View File

@@ -215,6 +215,8 @@ public final class AdapterMethodsTest {
+ "(com.squareup.moshi.AdapterMethodsTest$Point).\n" + "(com.squareup.moshi.AdapterMethodsTest$Point).\n"
+ "@ToJson method signatures may have one of the following structures:\n" + "@ToJson method signatures may have one of the following structures:\n"
+ " <any access modifier> void toJson(JsonWriter writer, T value) throws <any>;\n" + " <any access modifier> void toJson(JsonWriter writer, T value) throws <any>;\n"
+ " <any access modifier> void toJson(JsonReader jsonReader,"
+ " JsonAdapter<any> delegate, <any more delegates>) throws <any>;\n"
+ " <any access modifier> R toJson(T value) throws <any>;\n"); + " <any access modifier> R toJson(T value) throws <any>;\n");
} }
} }
@@ -234,7 +236,9 @@ public final class AdapterMethodsTest {
+ "com.squareup.moshi.AdapterMethodsTest$UnexpectedSignatureFromJsonAdapter.pointFromJson" + "com.squareup.moshi.AdapterMethodsTest$UnexpectedSignatureFromJsonAdapter.pointFromJson"
+ "(java.lang.String).\n" + "(java.lang.String).\n"
+ "@FromJson method signatures may have one of the following structures:\n" + "@FromJson method signatures may have one of the following structures:\n"
+ " <any access modifier> void fromJson(JsonReader jsonReader) throws <any>;\n" + " <any access modifier> R fromJson(JsonReader jsonReader) throws <any>;\n"
+ " <any access modifier> R fromJson(JsonReader jsonReader,"
+ " JsonAdapter<any> delegate, <any more delegates>) throws <any>;\n"
+ " <any access modifier> R fromJson(T value) throws <any>;\n"); + " <any access modifier> R fromJson(T value) throws <any>;\n");
} }
} }