File tree 2 files changed +23
-1
lines changed
main/java/com/google/gson
test/java/com/google/gson
2 files changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -299,18 +299,40 @@ public GsonBuilder newBuilder() {
299
299
return new GsonBuilder (this );
300
300
}
301
301
302
+ /**
303
+ * @deprecated This method by accident exposes an internal Gson class; it might be removed in a
304
+ * future version.
305
+ */
306
+ @ Deprecated
302
307
public Excluder excluder () {
303
308
return excluder ;
304
309
}
305
310
311
+ /**
312
+ * Returns the field naming strategy used by this Gson instance.
313
+ *
314
+ * @see GsonBuilder#setFieldNamingStrategy(FieldNamingStrategy)
315
+ */
306
316
public FieldNamingStrategy fieldNamingStrategy () {
307
317
return fieldNamingStrategy ;
308
318
}
309
319
320
+ /**
321
+ * Returns whether this Gson instance is serializing JSON object properties with
322
+ * {@code null} values, or just omits them.
323
+ *
324
+ * @see GsonBuilder#serializeNulls()
325
+ */
310
326
public boolean serializeNulls () {
311
327
return serializeNulls ;
312
328
}
313
329
330
+ /**
331
+ * Returns whether this Gson instance produces JSON output which is
332
+ * HTML-safe, that means all HTML characters are escaped.
333
+ *
334
+ * @see GsonBuilder#disableHtmlEscaping()
335
+ */
314
336
public boolean htmlSafe () {
315
337
return htmlSafe ;
316
338
}
Original file line number Diff line number Diff line change @@ -55,7 +55,7 @@ public void testOverridesDefaultExcluder() {
55
55
new ArrayList <TypeAdapterFactory >(), new ArrayList <TypeAdapterFactory >(),
56
56
CUSTOM_OBJECT_TO_NUMBER_STRATEGY , CUSTOM_NUMBER_TO_NUMBER_STRATEGY );
57
57
58
- assertEquals (CUSTOM_EXCLUDER , gson .excluder () );
58
+ assertEquals (CUSTOM_EXCLUDER , gson .excluder );
59
59
assertEquals (CUSTOM_FIELD_NAMING_STRATEGY , gson .fieldNamingStrategy ());
60
60
assertEquals (true , gson .serializeNulls ());
61
61
assertEquals (false , gson .htmlSafe ());
You can’t perform that action at this time.
0 commit comments