Package | Description |
---|---|
com.google.gson |
This package provides the
Gson class to convert Json to Java and
vice-versa. |
Modifier and Type | Method and Description |
---|---|
GsonBuilder |
GsonBuilder.addDeserializationExclusionStrategy(ExclusionStrategy strategy)
Configures Gson to apply the passed in exclusion strategy during deserialization.
|
GsonBuilder |
GsonBuilder.addSerializationExclusionStrategy(ExclusionStrategy strategy)
Configures Gson to apply the passed in exclusion strategy during serialization.
|
GsonBuilder |
GsonBuilder.disableHtmlEscaping()
By default, Gson escapes HTML characters such as < > etc.
|
GsonBuilder |
GsonBuilder.disableInnerClassSerialization()
Configures Gson to exclude inner classes during serialization.
|
GsonBuilder |
GsonBuilder.enableComplexMapKeySerialization()
Enabling this feature will only change the serialized form if the map key is
a complex type (i.e.
|
GsonBuilder |
GsonBuilder.excludeFieldsWithModifiers(int... modifiers)
Configures Gson to excludes all class fields that have the specified modifiers.
|
GsonBuilder |
GsonBuilder.excludeFieldsWithoutExposeAnnotation()
Configures Gson to exclude all fields from consideration for serialization or deserialization
that do not have the
Expose annotation. |
GsonBuilder |
GsonBuilder.generateNonExecutableJson()
Makes the output JSON non-executable in Javascript by prefixing the generated JSON with some
special text.
|
GsonBuilder |
Gson.newBuilder()
Returns a new GsonBuilder containing all custom factories and configuration used by the current
instance.
|
GsonBuilder |
GsonBuilder.registerTypeAdapter(java.lang.reflect.Type type,
java.lang.Object typeAdapter)
Configures Gson for custom serialization or deserialization.
|
GsonBuilder |
GsonBuilder.registerTypeAdapterFactory(TypeAdapterFactory factory)
Register a factory for type adapters.
|
GsonBuilder |
GsonBuilder.registerTypeHierarchyAdapter(java.lang.Class<?> baseType,
java.lang.Object typeAdapter)
Configures Gson for custom serialization or deserialization for an inheritance type hierarchy.
|
GsonBuilder |
GsonBuilder.serializeNulls()
Configure Gson to serialize null fields.
|
GsonBuilder |
GsonBuilder.serializeSpecialFloatingPointValues()
Section 2.4 of JSON specification disallows
special double values (NaN, Infinity, -Infinity).
|
GsonBuilder |
GsonBuilder.setDateFormat(int style)
Configures Gson to to serialize
Date objects according to the style value provided. |
GsonBuilder |
GsonBuilder.setDateFormat(int dateStyle,
int timeStyle)
Configures Gson to to serialize
Date objects according to the style value provided. |
GsonBuilder |
GsonBuilder.setDateFormat(java.lang.String pattern)
Configures Gson to serialize
Date objects according to the pattern provided. |
GsonBuilder |
GsonBuilder.setExclusionStrategies(ExclusionStrategy... strategies)
Configures Gson to apply a set of exclusion strategies during both serialization and
deserialization.
|
GsonBuilder |
GsonBuilder.setFieldNamingPolicy(FieldNamingPolicy namingConvention)
Configures Gson to apply a specific naming policy to an object's field during serialization
and deserialization.
|
GsonBuilder |
GsonBuilder.setFieldNamingStrategy(FieldNamingStrategy fieldNamingStrategy)
Configures Gson to apply a specific naming policy strategy to an object's field during
serialization and deserialization.
|
GsonBuilder |
GsonBuilder.setLenient()
By default, Gson is strict and only accepts JSON as specified by
RFC 4627.
|
GsonBuilder |
GsonBuilder.setLongSerializationPolicy(LongSerializationPolicy serializationPolicy)
Configures Gson to apply a specific serialization policy for
Long and long
objects. |
GsonBuilder |
GsonBuilder.setPrettyPrinting()
Configures Gson to output Json that fits in a page for pretty printing.
|
GsonBuilder |
GsonBuilder.setVersion(double ignoreVersionsAfter)
Configures Gson to enable versioning support.
|
Copyright © 2018. All Rights Reserved.