Uses of Class
com.google.gson.FormattingStyle
Packages that use FormattingStyle
Package
Description
This package provides the
Gson
class to convert Json to Java and
vice-versa.This package provides classes for processing JSON in an efficient streaming way.
-
Uses of FormattingStyle in com.google.gson
Fields in com.google.gson declared as FormattingStyleModifier and TypeFieldDescriptionstatic final FormattingStyle
FormattingStyle.COMPACT
The default compact formatting style: no newline no indent no space after','
and':'
(package private) static final FormattingStyle
(package private) final FormattingStyle
Gson.formattingStyle
private FormattingStyle
GsonBuilder.formattingStyle
static final FormattingStyle
FormattingStyle.PRETTY
The default pretty printing formatting style:"\n"
as newline two spaces as indent a space between':'
and the subsequent valueMethods in com.google.gson that return FormattingStyleModifier and TypeMethodDescriptionFormattingStyle.withIndent
(String indent) Creates aFormattingStyle
with the specified indent string.FormattingStyle.withNewline
(String newline) Creates aFormattingStyle
with the specified newline setting.FormattingStyle.withSpaceAfterSeparators
(boolean spaceAfterSeparators) Creates aFormattingStyle
which either uses a space after the separators','
and':'
in the JSON output, or not.Methods in com.google.gson with parameters of type FormattingStyleModifier and TypeMethodDescriptionGsonBuilder.setFormattingStyle
(FormattingStyle formattingStyle) Configures Gson to output JSON that uses a certain kind of formatting style (for example newline and indent).Constructors in com.google.gson with parameters of type FormattingStyleModifierConstructorDescription(package private)
Gson
(Excluder excluder, FieldNamingStrategy fieldNamingStrategy, Map<Type, InstanceCreator<?>> instanceCreators, boolean serializeNulls, boolean complexMapKeySerialization, boolean generateNonExecutableGson, boolean htmlSafe, FormattingStyle formattingStyle, Strictness strictness, boolean serializeSpecialFloatingPointValues, boolean useJdkUnsafe, LongSerializationPolicy longSerializationPolicy, String datePattern, int dateStyle, int timeStyle, List<TypeAdapterFactory> builderFactories, List<TypeAdapterFactory> builderHierarchyFactories, List<TypeAdapterFactory> factoriesToBeAdded, ToNumberStrategy objectToNumberStrategy, ToNumberStrategy numberToNumberStrategy, List<ReflectionAccessFilter> reflectionFilters) -
Uses of FormattingStyle in com.google.gson.stream
Fields in com.google.gson.stream declared as FormattingStyleMethods in com.google.gson.stream that return FormattingStyleModifier and TypeMethodDescriptionfinal FormattingStyle
JsonWriter.getFormattingStyle()
Returns the pretty printing style used by this writer.Methods in com.google.gson.stream with parameters of type FormattingStyleModifier and TypeMethodDescriptionfinal void
JsonWriter.setFormattingStyle
(FormattingStyle formattingStyle) Sets the formatting style to be used in the encoded document.