From 6ffcdf302939ad405abdfb468218b8caafc46e9c Mon Sep 17 00:00:00 2001
From: Marcono1234 Here is an example of how this annotation is used:
- *
- * @Intercept(postDeserialize=UserValidator.class)
+ *
+ * @Intercept(postDeserialize=UserValidator.class)
* public class User {
* String name;
* String password;
@@ -47,7 +47,7 @@ import java.lang.annotation.Target;
* }
* }
* }
- *
If the object that your are serializing/deserializing is a {@code ParameterizedType} * (i.e. contains at least one type parameter and may be an array) then you must use the @@ -91,7 +91,7 @@ import com.google.gson.stream.MalformedJsonException; * Gson gson = new Gson(); * String json = gson.toJson(target, listType); * List<String> target2 = gson.fromJson(json, listType); - *
+ * * *See the Gson User Guide * for a more complete set of examples.
@@ -548,7 +548,7 @@ public final class Gson { * read or written. * @param skipPast The type adapter factory that needs to be skipped while searching for * a matching type adapter. In most cases, you should just pass this (the type adapter - * factory from where {@link #getDelegateAdapter} method is being invoked). + * factory from where {@code getDelegateAdapter} method is being invoked). * @param type Type for which the delegate adapter is being searched for. * * @since 2.2 diff --git a/gson/src/main/java/com/google/gson/GsonBuilder.java b/gson/src/main/java/com/google/gson/GsonBuilder.java index b798604a..fa2bb926 100644 --- a/gson/src/main/java/com/google/gson/GsonBuilder.java +++ b/gson/src/main/java/com/google/gson/GsonBuilder.java @@ -61,7 +61,7 @@ import static com.google.gson.Gson.DEFAULT_SPECIALIZE_FLOAT_VALUES; * .setPrettyPrinting() * .setVersion(1.0) * .create(); - * + * * *NOTES: *
{@code diff --git a/gson/src/main/java/com/google/gson/JsonSerializer.java b/gson/src/main/java/com/google/gson/JsonSerializer.java index a6050033..19eaf17d 100644 --- a/gson/src/main/java/com/google/gson/JsonSerializer.java +++ b/gson/src/main/java/com/google/gson/JsonSerializer.java @@ -26,7 +26,7 @@ import java.lang.reflect.Type; *Let us look at example where defining a serializer will be useful. The {@code Id} class * defined below has two fields: {@code clazz} and {@code value}.
* - *+ ** ** public class Id<T> { * private final Class<T> clazz; * private final long value; @@ -40,20 +40,20 @@ import java.lang.reflect.Type; * return value; * } * } - *+ *The default serialization of {@code Id(com.foo.MyObject.class, 20L)} will be *
* - *{"clazz":com.foo.MyObject,"value":20}
. Suppose, you just want the output to be * the value instead, which is {@code 20} in this case. You can achieve that by writing a custom * serializer:+ ** ** class IdSerializer implements JsonSerializer<Id>() { * public JsonElement serialize(Id id, Type typeOfId, JsonSerializationContext context) { * return new JsonPrimitive(id.getValue()); * } * } - *+ *You will also need to register {@code IdSerializer} with Gson as follows:
*diff --git a/gson/src/main/java/com/google/gson/ToNumberStrategy.java b/gson/src/main/java/com/google/gson/ToNumberStrategy.java index db42a4ef..3cd84fa5 100644 --- a/gson/src/main/java/com/google/gson/ToNumberStrategy.java +++ b/gson/src/main/java/com/google/gson/ToNumberStrategy.java @@ -65,7 +65,6 @@ public interface ToNumberStrategy { * * @param in JSON reader to read a number from * @return number read from the JSON reader. - * @throws IOException */ public Number readNumber(JsonReader in) throws IOException; } diff --git a/gson/src/main/java/com/google/gson/annotations/Expose.java b/gson/src/main/java/com/google/gson/annotations/Expose.java index 19a92970..966460db 100644 --- a/gson/src/main/java/com/google/gson/annotations/Expose.java +++ b/gson/src/main/java/com/google/gson/annotations/Expose.java @@ -32,14 +32,14 @@ import java.lang.annotation.Target; * method. * *Here is an example of how this annotation is meant to be used: - *
+ ** If you created Gson with {@code new Gson()}, the {@code toJson()} and {@code fromJson()} * methods will use the {@code password} field along-with {@code firstName}, {@code lastName}, * and {@code emailAddress} for serialization and deserialization. However, if you created Gson diff --git a/gson/src/main/java/com/google/gson/stream/JsonReader.java b/gson/src/main/java/com/google/gson/stream/JsonReader.java index 59a9bf53..a8cb22aa 100644 --- a/gson/src/main/java/com/google/gson/stream/JsonReader.java +++ b/gson/src/main/java/com/google/gson/stream/JsonReader.java @@ -170,7 +170,7 @@ import java.util.Arrays; * precision loss, extremely large values should be written and read as strings * in JSON. * - ** public class User { * @Expose private String firstName; * @Expose(serialize = false) private String lastName; * @Expose (serialize = false, deserialize = false) private String emailAddress; * private String password; * } - *+ *Non-Execute Prefix
+ *Non-Execute Prefix
* Web servers that serve private data using JSON may be vulnerable to Cross-site * request forgery attacks. In such an attack, a malicious site gains access diff --git a/proto/src/main/java/com/google/gson/protobuf/ProtoTypeAdapter.java b/proto/src/main/java/com/google/gson/protobuf/ProtoTypeAdapter.java index eb4a4f54..d588d824 100644 --- a/proto/src/main/java/com/google/gson/protobuf/ProtoTypeAdapter.java +++ b/proto/src/main/java/com/google/gson/protobuf/ProtoTypeAdapter.java @@ -37,7 +37,6 @@ import com.google.protobuf.Descriptors.FieldDescriptor; import com.google.protobuf.DynamicMessage; import com.google.protobuf.Extension; import com.google.protobuf.Message; - import java.lang.reflect.Field; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; @@ -76,7 +75,7 @@ public class ProtoTypeAdapter /** * Determines how enum values should be serialized. */ - public static enum EnumSerialization { + public enum EnumSerialization { /** * Serializes and deserializes enum values using their number. When this is used, custom * value names set on enums are ignored. @@ -117,12 +116,12 @@ public class ProtoTypeAdapter * For example, if you use the following parameters: {@link CaseFormat#LOWER_UNDERSCORE}, * {@link CaseFormat#LOWER_CAMEL}, the following conversion will occur: * - *+ **/ public Builder setFieldNameSerializationFormat(CaseFormat fromFieldNameFormat, CaseFormat toFieldNameFormat) {{@code * PROTO <-> JSON * my_field myField * foo foo * n__id_ct nIdCt - *+ * }