Uses of Class
com.google.gson.GsonBuilder
Packages that use GsonBuilder
-
Uses of GsonBuilder in com.google.gson
Methods in com.google.gson that return GsonBuilderModifier and TypeMethodDescriptionGsonBuilder.addDeserializationExclusionStrategy
(ExclusionStrategy strategy) Configures Gson to apply the passed in exclusion strategy during deserialization.GsonBuilder.addReflectionAccessFilter
(ReflectionAccessFilter filter) Adds a reflection access filter.GsonBuilder.addSerializationExclusionStrategy
(ExclusionStrategy strategy) Configures Gson to apply the passed in exclusion strategy during serialization.GsonBuilder.disableHtmlEscaping()
By default, Gson escapes HTML characters such as < > etc.GsonBuilder.disableInnerClassSerialization()
Configures Gson to exclude inner classes (= non-static
nested classes) during serialization and deserialization.GsonBuilder.disableJdkUnsafe()
Disables usage of JDK'ssun.misc.Unsafe
.GsonBuilder.enableComplexMapKeySerialization()
Enabling this feature will only change the serialized form if the map key is a complex type (i.e.GsonBuilder.excludeFieldsWithModifiers
(int... modifiers) Configures Gson to excludes all class fields that have the specified modifiers.GsonBuilder.excludeFieldsWithoutExposeAnnotation()
Configures Gson to exclude all fields from consideration for serialization and deserialization that do not have theExpose
annotation.GsonBuilder.generateNonExecutableJson()
Makes the output JSON non-executable in Javascript by prefixing the generated JSON with some special text.Gson.newBuilder()
Returns a new GsonBuilder containing all custom factories and configuration used by the current instance.GsonBuilder.registerTypeAdapter
(Type type, Object typeAdapter) Configures Gson for custom serialization or deserialization.GsonBuilder.registerTypeAdapterFactory
(TypeAdapterFactory factory) Register a factory for type adapters.GsonBuilder.registerTypeHierarchyAdapter
(Class<?> baseType, Object typeAdapter) Configures Gson for custom serialization or deserialization for an inheritance type hierarchy.GsonBuilder.serializeNulls()
Configure Gson to serialize null fields.GsonBuilder.serializeSpecialFloatingPointValues()
Section 2.4 of JSON specification disallows special double values (NaN, Infinity, -Infinity).GsonBuilder.setDateFormat
(int style) Configures Gson to to serializeDate
objects according to the style value provided.GsonBuilder.setDateFormat
(int dateStyle, int timeStyle) Configures Gson to to serializeDate
objects according to the style value provided.GsonBuilder.setDateFormat
(String pattern) Configures Gson to serializeDate
objects according to the pattern provided.GsonBuilder.setExclusionStrategies
(ExclusionStrategy... strategies) Configures Gson to apply a set of exclusion strategies during both serialization and deserialization.GsonBuilder.setFieldNamingPolicy
(FieldNamingPolicy namingConvention) Configures Gson to apply a specific naming policy to an object's fields during serialization and deserialization.GsonBuilder.setFieldNamingStrategy
(FieldNamingStrategy fieldNamingStrategy) Configures Gson to apply a specific naming strategy to an object's fields during serialization and deserialization.GsonBuilder.setLenient()
Configures Gson to allow JSON data which does not strictly comply with the JSON specification.GsonBuilder.setLongSerializationPolicy
(LongSerializationPolicy serializationPolicy) Configures Gson to apply a specific serialization policy forLong
andlong
objects.GsonBuilder.setNumberToNumberStrategy
(ToNumberStrategy numberToNumberStrategy) Configures Gson to apply a specific number strategy during deserialization ofNumber
.GsonBuilder.setObjectToNumberStrategy
(ToNumberStrategy objectToNumberStrategy) Configures Gson to apply a specific number strategy during deserialization ofObject
.GsonBuilder.setPrettyPrinting()
Configures Gson to output Json that fits in a page for pretty printing.GsonBuilder.setVersion
(double version) Configures Gson to enable versioning support. -
Uses of GsonBuilder in com.google.gson.graph
Methods in com.google.gson.graph with parameters of type GsonBuilder