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-staticnested classes) during serialization and deserialization.GsonBuilder.disableJdkUnsafe()Disables usage of JDK'ssun.misc.Unsafe.GsonBuilder.enableComplexMapKeySerialization()Configures Gson to serializeMapobjects with complex keys as JSON arrays.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 theExposeannotation.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) Registers 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()Configures Gson to serialize null fields.GsonBuilder.serializeSpecialFloatingPointValues()Section 6 of JSON specification disallows special double values (NaN, Infinity, -Infinity).GsonBuilder.setDateFormat(int dateStyle) Deprecated.GsonBuilder.setDateFormat(int dateStyle, int timeStyle) Configures Gson to serializeDateobjects according to the style value provided.GsonBuilder.setDateFormat(String pattern) Configures Gson to serializeDateobjects 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.setFormattingStyle(FormattingStyle formattingStyle) Configures Gson to output JSON that uses a certain kind of formatting style (for example newline and indent).GsonBuilder.setLenient()Deprecated.This method is equivalent to callingsetStrictness(Strictness)withStrictness.LENIENT:setStrictness(Strictness.LENIENT)GsonBuilder.setLongSerializationPolicy(LongSerializationPolicy serializationPolicy) Configures Gson to apply a specific serialization policy forLongandlongobjects.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.setStrictness(Strictness strictness) Sets the strictness of this builder to the provided parameter.GsonBuilder.setVersion(double version) Configures Gson to enable versioning support.
setDateFormat(int, int).