Skip to content

Commit 91d22b3

Browse files
authored
Add more Javadoc cross-links between methods (#2678)
1 parent 4f12c00 commit 91d22b3

File tree

3 files changed

+22
-2
lines changed

3 files changed

+22
-2
lines changed

gson/src/main/java/com/google/gson/FormattingStyle.java

+11-2
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ private FormattingStyle(String newline, String indent, boolean spaceAfterSeparat
9090
*
9191
* @param newline the string value that will be used as newline.
9292
* @return a newly created {@link FormattingStyle}
93+
* @see #getNewline()
9394
*/
9495
public FormattingStyle withNewline(String newline) {
9596
return new FormattingStyle(newline, this.indent, this.spaceAfterSeparators);
@@ -98,10 +99,11 @@ public FormattingStyle withNewline(String newline) {
9899
/**
99100
* Creates a {@link FormattingStyle} with the specified indent string.
100101
*
101-
* <p>Only combinations of spaces and tabs allowed in indent.
102+
* <p>Only combinations of spaces and tabs are allowed in indent.
102103
*
103104
* @param indent the string value that will be used as indent.
104105
* @return a newly created {@link FormattingStyle}
106+
* @see #getIndent()
105107
*/
106108
public FormattingStyle withIndent(String indent) {
107109
return new FormattingStyle(this.newline, indent, this.spaceAfterSeparators);
@@ -117,6 +119,7 @@ public FormattingStyle withIndent(String indent) {
117119
*
118120
* @param spaceAfterSeparators whether to output a space after {@code ','} and {@code ':'}.
119121
* @return a newly created {@link FormattingStyle}
122+
* @see #usesSpaceAfterSeparators()
120123
*/
121124
public FormattingStyle withSpaceAfterSeparators(boolean spaceAfterSeparators) {
122125
return new FormattingStyle(this.newline, this.indent, spaceAfterSeparators);
@@ -126,6 +129,7 @@ public FormattingStyle withSpaceAfterSeparators(boolean spaceAfterSeparators) {
126129
* Returns the string value that will be used as a newline.
127130
*
128131
* @return the newline value.
132+
* @see #withNewline(String)
129133
*/
130134
public String getNewline() {
131135
return this.newline;
@@ -135,12 +139,17 @@ public String getNewline() {
135139
* Returns the string value that will be used as indent.
136140
*
137141
* @return the indent value.
142+
* @see #withIndent(String)
138143
*/
139144
public String getIndent() {
140145
return this.indent;
141146
}
142147

143-
/** Returns whether a space will be used after {@code ','} and {@code ':'}. */
148+
/**
149+
* Returns whether a space will be used after {@code ','} and {@code ':'}.
150+
*
151+
* @see #withSpaceAfterSeparators(boolean)
152+
*/
144153
public boolean usesSpaceAfterSeparators() {
145154
return this.spaceAfterSeparators;
146155
}

gson/src/main/java/com/google/gson/Strictness.java

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
* the {@link JsonReader} and you can look at {@link JsonWriter#setStrictness(Strictness)} to see
1313
* how the strictness affects the {@link JsonWriter}.
1414
*
15+
* @see GsonBuilder#setStrictness(Strictness)
1516
* @see JsonReader#setStrictness(Strictness)
1617
* @see JsonWriter#setStrictness(Strictness)
1718
* @since 2.11.0

gson/src/main/java/com/google/gson/stream/JsonWriter.java

+10
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,7 @@ public final void setIndent(String indent) {
261261
* level of indentation, or the newline style, to accommodate various OS styles.
262262
*
263263
* @param formattingStyle the formatting style to use, must not be {@code null}.
264+
* @see #getFormattingStyle()
264265
* @since 2.11.0
265266
*/
266267
public final void setFormattingStyle(FormattingStyle formattingStyle) {
@@ -286,6 +287,7 @@ public final void setFormattingStyle(FormattingStyle formattingStyle) {
286287
* Returns the pretty printing style used by this writer.
287288
*
288289
* @return the {@code FormattingStyle} that will be used.
290+
* @see #setFormattingStyle(FormattingStyle)
289291
* @since 2.11.0
290292
*/
291293
public final FormattingStyle getFormattingStyle() {
@@ -360,13 +362,17 @@ public final Strictness getStrictness() {
360362
* This escapes the HTML characters {@code <}, {@code >}, {@code &}, {@code =} and {@code '}
361363
* before writing them to the stream. Without this setting, your XML/HTML encoder should replace
362364
* these characters with the corresponding escape sequences.
365+
*
366+
* @see #isHtmlSafe()
363367
*/
364368
public final void setHtmlSafe(boolean htmlSafe) {
365369
this.htmlSafe = htmlSafe;
366370
}
367371

368372
/**
369373
* Returns true if this writer writes JSON that's safe for inclusion in HTML and XML documents.
374+
*
375+
* @see #setHtmlSafe(boolean)
370376
*/
371377
public final boolean isHtmlSafe() {
372378
return htmlSafe;
@@ -375,6 +381,8 @@ public final boolean isHtmlSafe() {
375381
/**
376382
* Sets whether object members are serialized when their value is null. This has no impact on
377383
* array elements. The default is true.
384+
*
385+
* @see #getSerializeNulls()
378386
*/
379387
public final void setSerializeNulls(boolean serializeNulls) {
380388
this.serializeNulls = serializeNulls;
@@ -383,6 +391,8 @@ public final void setSerializeNulls(boolean serializeNulls) {
383391
/**
384392
* Returns true if object members are serialized when their value is null. This has no impact on
385393
* array elements. The default is true.
394+
*
395+
* @see #setSerializeNulls(boolean)
386396
*/
387397
public final boolean getSerializeNulls() {
388398
return serializeNulls;

0 commit comments

Comments
 (0)