Fix javadoc doclint HTML warnings (#1653)
This commit is contained in:
parent
adc4c1949d
commit
530cb74470
|
@ -46,11 +46,11 @@ package com.google.gson;
|
||||||
*
|
*
|
||||||
* <p><strong>Excludes fields and objects based on a particular annotation:</strong>
|
* <p><strong>Excludes fields and objects based on a particular annotation:</strong>
|
||||||
* <pre class="code">
|
* <pre class="code">
|
||||||
* public @interface FooAnnotation {
|
* public @interface FooAnnotation {
|
||||||
* // some implementation here
|
* // some implementation here
|
||||||
* }
|
* }
|
||||||
*
|
*
|
||||||
* // Excludes any field (or class) that is tagged with an "@FooAnnotation"
|
* // Excludes any field (or class) that is tagged with an "@FooAnnotation"
|
||||||
* private static class FooAnnotationExclusionStrategy implements ExclusionStrategy {
|
* private static class FooAnnotationExclusionStrategy implements ExclusionStrategy {
|
||||||
* public boolean shouldSkipClass(Class<?> clazz) {
|
* public boolean shouldSkipClass(Class<?> clazz) {
|
||||||
* return clazz.getAnnotation(FooAnnotation.class) != null;
|
* return clazz.getAnnotation(FooAnnotation.class) != null;
|
||||||
|
|
|
@ -44,10 +44,10 @@ public enum FieldNamingPolicy implements FieldNamingStrategy {
|
||||||
* Using this naming policy with Gson will ensure that the first "letter" of the Java
|
* Using this naming policy with Gson will ensure that the first "letter" of the Java
|
||||||
* field name is capitalized when serialized to its JSON form.
|
* field name is capitalized when serialized to its JSON form.
|
||||||
*
|
*
|
||||||
* <p>Here's a few examples of the form "Java Field Name" ---> "JSON Field Name":</p>
|
* <p>Here's a few examples of the form "Java Field Name" ---> "JSON Field Name":</p>
|
||||||
* <ul>
|
* <ul>
|
||||||
* <li>someFieldName ---> SomeFieldName</li>
|
* <li>someFieldName ---> SomeFieldName</li>
|
||||||
* <li>_someFieldName ---> _SomeFieldName</li>
|
* <li>_someFieldName ---> _SomeFieldName</li>
|
||||||
* </ul>
|
* </ul>
|
||||||
*/
|
*/
|
||||||
UPPER_CAMEL_CASE() {
|
UPPER_CAMEL_CASE() {
|
||||||
|
@ -61,10 +61,10 @@ public enum FieldNamingPolicy implements FieldNamingStrategy {
|
||||||
* field name is capitalized when serialized to its JSON form and the words will be
|
* field name is capitalized when serialized to its JSON form and the words will be
|
||||||
* separated by a space.
|
* separated by a space.
|
||||||
*
|
*
|
||||||
* <p>Here's a few examples of the form "Java Field Name" ---> "JSON Field Name":</p>
|
* <p>Here's a few examples of the form "Java Field Name" ---> "JSON Field Name":</p>
|
||||||
* <ul>
|
* <ul>
|
||||||
* <li>someFieldName ---> Some Field Name</li>
|
* <li>someFieldName ---> Some Field Name</li>
|
||||||
* <li>_someFieldName ---> _Some Field Name</li>
|
* <li>_someFieldName ---> _Some Field Name</li>
|
||||||
* </ul>
|
* </ul>
|
||||||
*
|
*
|
||||||
* @since 1.4
|
* @since 1.4
|
||||||
|
@ -79,12 +79,12 @@ public enum FieldNamingPolicy implements FieldNamingStrategy {
|
||||||
* Using this naming policy with Gson will modify the Java Field name from its camel cased
|
* Using this naming policy with Gson will modify the Java Field name from its camel cased
|
||||||
* form to a lower case field name where each word is separated by an underscore (_).
|
* form to a lower case field name where each word is separated by an underscore (_).
|
||||||
*
|
*
|
||||||
* <p>Here's a few examples of the form "Java Field Name" ---> "JSON Field Name":</p>
|
* <p>Here's a few examples of the form "Java Field Name" ---> "JSON Field Name":</p>
|
||||||
* <ul>
|
* <ul>
|
||||||
* <li>someFieldName ---> some_field_name</li>
|
* <li>someFieldName ---> some_field_name</li>
|
||||||
* <li>_someFieldName ---> _some_field_name</li>
|
* <li>_someFieldName ---> _some_field_name</li>
|
||||||
* <li>aStringField ---> a_string_field</li>
|
* <li>aStringField ---> a_string_field</li>
|
||||||
* <li>aURL ---> a_u_r_l</li>
|
* <li>aURL ---> a_u_r_l</li>
|
||||||
* </ul>
|
* </ul>
|
||||||
*/
|
*/
|
||||||
LOWER_CASE_WITH_UNDERSCORES() {
|
LOWER_CASE_WITH_UNDERSCORES() {
|
||||||
|
@ -97,12 +97,12 @@ public enum FieldNamingPolicy implements FieldNamingStrategy {
|
||||||
* Using this naming policy with Gson will modify the Java Field name from its camel cased
|
* Using this naming policy with Gson will modify the Java Field name from its camel cased
|
||||||
* form to a lower case field name where each word is separated by a dash (-).
|
* form to a lower case field name where each word is separated by a dash (-).
|
||||||
*
|
*
|
||||||
* <p>Here's a few examples of the form "Java Field Name" ---> "JSON Field Name":</p>
|
* <p>Here's a few examples of the form "Java Field Name" ---> "JSON Field Name":</p>
|
||||||
* <ul>
|
* <ul>
|
||||||
* <li>someFieldName ---> some-field-name</li>
|
* <li>someFieldName ---> some-field-name</li>
|
||||||
* <li>_someFieldName ---> _some-field-name</li>
|
* <li>_someFieldName ---> _some-field-name</li>
|
||||||
* <li>aStringField ---> a-string-field</li>
|
* <li>aStringField ---> a-string-field</li>
|
||||||
* <li>aURL ---> a-u-r-l</li>
|
* <li>aURL ---> a-u-r-l</li>
|
||||||
* </ul>
|
* </ul>
|
||||||
* Using dashes in JavaScript is not recommended since dash is also used for a minus sign in
|
* Using dashes in JavaScript is not recommended since dash is also used for a minus sign in
|
||||||
* expressions. This requires that a field named with dashes is always accessed as a quoted
|
* expressions. This requires that a field named with dashes is always accessed as a quoted
|
||||||
|
@ -120,12 +120,12 @@ public enum FieldNamingPolicy implements FieldNamingStrategy {
|
||||||
* Using this naming policy with Gson will modify the Java Field name from its camel cased
|
* Using this naming policy with Gson will modify the Java Field name from its camel cased
|
||||||
* form to a lower case field name where each word is separated by a dot (.).
|
* form to a lower case field name where each word is separated by a dot (.).
|
||||||
*
|
*
|
||||||
* <p>Here's a few examples of the form "Java Field Name" ---> "JSON Field Name":</p>
|
* <p>Here's a few examples of the form "Java Field Name" ---> "JSON Field Name":</p>
|
||||||
* <ul>
|
* <ul>
|
||||||
* <li>someFieldName ---> some.field.name</li>
|
* <li>someFieldName ---> some.field.name</li>
|
||||||
* <li>_someFieldName ---> _some.field.name</li>
|
* <li>_someFieldName ---> _some.field.name</li>
|
||||||
* <li>aStringField ---> a.string.field</li>
|
* <li>aStringField ---> a.string.field</li>
|
||||||
* <li>aURL ---> a.u.r.l</li>
|
* <li>aURL ---> a.u.r.l</li>
|
||||||
* </ul>
|
* </ul>
|
||||||
* Using dots in JavaScript is not recommended since dot is also used for a member sign in
|
* Using dots in JavaScript is not recommended since dot is also used for a member sign in
|
||||||
* expressions. This requires that a field named with dots is always accessed as a quoted
|
* expressions. This requires that a field named with dots is always accessed as a quoted
|
||||||
|
|
|
@ -34,9 +34,9 @@ import java.lang.annotation.Target;
|
||||||
* <p>Here is an example of how this annotation is meant to be used:
|
* <p>Here is an example of how this annotation is meant to be used:
|
||||||
* <p><pre>
|
* <p><pre>
|
||||||
* public class User {
|
* public class User {
|
||||||
* @Expose private String firstName;
|
* @Expose private String firstName;
|
||||||
* @Expose(serialize = false) private String lastName;
|
* @Expose(serialize = false) private String lastName;
|
||||||
* @Expose (serialize = false, deserialize = false) private String emailAddress;
|
* @Expose (serialize = false, deserialize = false) private String emailAddress;
|
||||||
* private String password;
|
* private String password;
|
||||||
* }
|
* }
|
||||||
* </pre></p>
|
* </pre></p>
|
||||||
|
|
|
@ -31,7 +31,7 @@ import java.lang.annotation.Target;
|
||||||
*
|
*
|
||||||
* <p>Here is an example of how this annotation is used:</p>
|
* <p>Here is an example of how this annotation is used:</p>
|
||||||
* <pre>
|
* <pre>
|
||||||
* @JsonAdapter(UserJsonAdapter.class)
|
* @JsonAdapter(UserJsonAdapter.class)
|
||||||
* public class User {
|
* public class User {
|
||||||
* public final String firstName, lastName;
|
* public final String firstName, lastName;
|
||||||
* private User(String firstName, String lastName) {
|
* private User(String firstName, String lastName) {
|
||||||
|
@ -40,7 +40,7 @@ import java.lang.annotation.Target;
|
||||||
* }
|
* }
|
||||||
* }
|
* }
|
||||||
* public class UserJsonAdapter extends TypeAdapter<User> {
|
* public class UserJsonAdapter extends TypeAdapter<User> {
|
||||||
* @Override public void write(JsonWriter out, User user) throws IOException {
|
* @Override public void write(JsonWriter out, User user) throws IOException {
|
||||||
* // implement write: combine firstName and lastName into name
|
* // implement write: combine firstName and lastName into name
|
||||||
* out.beginObject();
|
* out.beginObject();
|
||||||
* out.name("name");
|
* out.name("name");
|
||||||
|
@ -48,7 +48,7 @@ import java.lang.annotation.Target;
|
||||||
* out.endObject();
|
* out.endObject();
|
||||||
* // implement the write method
|
* // implement the write method
|
||||||
* }
|
* }
|
||||||
* @Override public User read(JsonReader in) throws IOException {
|
* @Override public User read(JsonReader in) throws IOException {
|
||||||
* // implement read: split name into firstName and lastName
|
* // implement read: split name into firstName and lastName
|
||||||
* in.beginObject();
|
* in.beginObject();
|
||||||
* in.nextName();
|
* in.nextName();
|
||||||
|
@ -59,13 +59,13 @@ import java.lang.annotation.Target;
|
||||||
* }
|
* }
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* Since User class specified UserJsonAdapter.class in @JsonAdapter annotation, it
|
* Since User class specified UserJsonAdapter.class in @JsonAdapter annotation, it
|
||||||
* will automatically be invoked to serialize/deserialize User instances. <br>
|
* will automatically be invoked to serialize/deserialize User instances. <br>
|
||||||
*
|
*
|
||||||
* <p> Here is an example of how to apply this annotation to a field.
|
* <p> Here is an example of how to apply this annotation to a field.
|
||||||
* <pre>
|
* <pre>
|
||||||
* private static final class Gadget {
|
* private static final class Gadget {
|
||||||
* @JsonAdapter(UserJsonAdapter2.class)
|
* @JsonAdapter(UserJsonAdapter2.class)
|
||||||
* final User user;
|
* final User user;
|
||||||
* Gadget(User user) {
|
* Gadget(User user) {
|
||||||
* this.user = user;
|
* this.user = user;
|
||||||
|
|
|
@ -35,8 +35,8 @@ import java.lang.annotation.Target;
|
||||||
* <p>Here is an example of how this annotation is meant to be used:</p>
|
* <p>Here is an example of how this annotation is meant to be used:</p>
|
||||||
* <pre>
|
* <pre>
|
||||||
* public class MyClass {
|
* public class MyClass {
|
||||||
* @SerializedName("name") String a;
|
* @SerializedName("name") String a;
|
||||||
* @SerializedName(value="name1", alternate={"name2", "name3"}) String b;
|
* @SerializedName(value="name1", alternate={"name2", "name3"}) String b;
|
||||||
* String c;
|
* String c;
|
||||||
*
|
*
|
||||||
* public MyClass(String a, String b, String c) {
|
* public MyClass(String a, String b, String c) {
|
||||||
|
|
|
@ -36,9 +36,9 @@ import java.lang.annotation.Target;
|
||||||
* public class User {
|
* public class User {
|
||||||
* private String firstName;
|
* private String firstName;
|
||||||
* private String lastName;
|
* private String lastName;
|
||||||
* @Since(1.0) private String emailAddress;
|
* @Since(1.0) private String emailAddress;
|
||||||
* @Since(1.0) private String password;
|
* @Since(1.0) private String password;
|
||||||
* @Since(1.1) private Address address;
|
* @Since(1.1) private Address address;
|
||||||
* }
|
* }
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
|
|
@ -38,8 +38,8 @@ import java.lang.annotation.Target;
|
||||||
* public class User {
|
* public class User {
|
||||||
* private String firstName;
|
* private String firstName;
|
||||||
* private String lastName;
|
* private String lastName;
|
||||||
* @Until(1.1) private String emailAddress;
|
* @Until(1.1) private String emailAddress;
|
||||||
* @Until(1.1) private String password;
|
* @Until(1.1) private String password;
|
||||||
* }
|
* }
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
|
|
@ -170,7 +170,7 @@ import java.util.Arrays;
|
||||||
* precision loss, extremely large values should be written and read as strings
|
* precision loss, extremely large values should be written and read as strings
|
||||||
* in JSON.
|
* in JSON.
|
||||||
*
|
*
|
||||||
* <a name="nonexecuteprefix"/><h3>Non-Execute Prefix</h3>
|
* <a id="nonexecuteprefix"/><h3>Non-Execute Prefix</h3>
|
||||||
* Web servers that serve private data using JSON may be vulnerable to <a
|
* Web servers that serve private data using JSON may be vulnerable to <a
|
||||||
* href="http://en.wikipedia.org/wiki/JSON#Cross-site_request_forgery">Cross-site
|
* href="http://en.wikipedia.org/wiki/JSON#Cross-site_request_forgery">Cross-site
|
||||||
* request forgery</a> attacks. In such an attack, a malicious site gains access
|
* request forgery</a> attacks. In such an attack, a malicious site gains access
|
||||||
|
|
Loading…
Reference in New Issue
Block a user