$ A B C D E F G H I J K L M N O P R S T U V W
All Classes All Packages
All Classes All Packages
All Classes All Packages
$
- $Gson$Preconditions - Class in com.google.gson.internal
-
A simple utility class used to check method Preconditions.
- $Gson$Types - Class in com.google.gson.internal
-
Static methods for working with types.
A
- add(JsonElement) - Method in class com.google.gson.JsonArray
-
Adds the specified element to self.
- add(Boolean) - Method in class com.google.gson.JsonArray
-
Adds the specified boolean to self.
- add(Character) - Method in class com.google.gson.JsonArray
-
Adds the specified character to self.
- add(Number) - Method in class com.google.gson.JsonArray
-
Adds the specified number to self.
- add(String) - Method in class com.google.gson.JsonArray
-
Adds the specified string to self.
- add(String, JsonElement) - Method in class com.google.gson.JsonObject
-
Adds a member, which is a name-value pair, to self.
- addAll(JsonArray) - Method in class com.google.gson.JsonArray
-
Adds all the elements of the specified array to self.
- addDeserializationExclusionStrategy(ExclusionStrategy) - Method in class com.google.gson.GsonBuilder
-
Configures Gson to apply the passed in exclusion strategy during deserialization.
- addProperty(String, Boolean) - Method in class com.google.gson.JsonObject
-
Convenience method to add a boolean member.
- addProperty(String, Character) - Method in class com.google.gson.JsonObject
-
Convenience method to add a char member.
- addProperty(String, Number) - Method in class com.google.gson.JsonObject
-
Convenience method to add a primitive member.
- addProperty(String, String) - Method in class com.google.gson.JsonObject
-
Convenience method to add a primitive member.
- addSerializationExclusionStrategy(ExclusionStrategy) - Method in class com.google.gson.GsonBuilder
-
Configures Gson to apply the passed in exclusion strategy during serialization.
- addType(Type) - Method in class com.google.gson.graph.GraphAdapterBuilder
- addType(Type, InstanceCreator<?>) - Method in class com.google.gson.graph.GraphAdapterBuilder
- alternate() - Method in annotation type com.google.gson.annotations.SerializedName
- arrayOf(Type) - Static method in class com.google.gson.internal.$Gson$Types
-
Returns an array type whose elements are all instances of
componentType
. - ArrayTypeAdapter<E> - Class in com.google.gson.internal.bind
-
Adapt an array of objects.
- ArrayTypeAdapter(Gson, TypeAdapter<E>, Class<E>) - Constructor for class com.google.gson.internal.bind.ArrayTypeAdapter
- ATOMIC_BOOLEAN - Static variable in class com.google.gson.internal.bind.TypeAdapters
- ATOMIC_BOOLEAN_FACTORY - Static variable in class com.google.gson.internal.bind.TypeAdapters
- ATOMIC_INTEGER - Static variable in class com.google.gson.internal.bind.TypeAdapters
- ATOMIC_INTEGER_ARRAY - Static variable in class com.google.gson.internal.bind.TypeAdapters
- ATOMIC_INTEGER_ARRAY_FACTORY - Static variable in class com.google.gson.internal.bind.TypeAdapters
- ATOMIC_INTEGER_FACTORY - Static variable in class com.google.gson.internal.bind.TypeAdapters
B
- BEGIN_ARRAY - com.google.gson.stream.JsonToken
-
The opening of a JSON array.
- BEGIN_OBJECT - com.google.gson.stream.JsonToken
-
The opening of a JSON object.
- beginArray() - Method in class com.google.gson.internal.bind.JsonTreeReader
- beginArray() - Method in class com.google.gson.internal.bind.JsonTreeWriter
- beginArray() - Method in class com.google.gson.stream.JsonReader
-
Consumes the next token from the JSON stream and asserts that it is the beginning of a new array.
- beginArray() - Method in class com.google.gson.stream.JsonWriter
-
Begins encoding a new array.
- beginObject() - Method in class com.google.gson.internal.bind.JsonTreeReader
- beginObject() - Method in class com.google.gson.internal.bind.JsonTreeWriter
- beginObject() - Method in class com.google.gson.stream.JsonReader
-
Consumes the next token from the JSON stream and asserts that it is the beginning of a new object.
- beginObject() - Method in class com.google.gson.stream.JsonWriter
-
Begins encoding a new object.
- BIG_DECIMAL - com.google.gson.ToNumberPolicy
-
Using this policy will ensure that numbers will be read as numbers of arbitrary length using
BigDecimal
. - BIG_DECIMAL - Static variable in class com.google.gson.internal.bind.TypeAdapters
- BIG_INTEGER - Static variable in class com.google.gson.internal.bind.TypeAdapters
- BIT_SET - Static variable in class com.google.gson.internal.bind.TypeAdapters
- BIT_SET_FACTORY - Static variable in class com.google.gson.internal.bind.TypeAdapters
- BOOLEAN - com.google.gson.stream.JsonToken
-
A JSON
true
orfalse
. - BOOLEAN - Static variable in class com.google.gson.internal.bind.TypeAdapters
- BOOLEAN_AS_STRING - Static variable in class com.google.gson.internal.bind.TypeAdapters
-
Writes a boolean as a string.
- BOOLEAN_FACTORY - Static variable in class com.google.gson.internal.bind.TypeAdapters
- BYTE - Static variable in class com.google.gson.internal.bind.TypeAdapters
- BYTE_FACTORY - Static variable in class com.google.gson.internal.bind.TypeAdapters
C
- CALENDAR - Static variable in class com.google.gson.internal.bind.TypeAdapters
- CALENDAR_FACTORY - Static variable in class com.google.gson.internal.bind.TypeAdapters
- canonicalize(Type) - Static method in class com.google.gson.internal.$Gson$Types
-
Returns a type that is functionally equal but not necessarily equal according to
Object.equals()
. - CHARACTER - Static variable in class com.google.gson.internal.bind.TypeAdapters
- CHARACTER_FACTORY - Static variable in class com.google.gson.internal.bind.TypeAdapters
- checkArgument(boolean) - Static method in class com.google.gson.internal.$Gson$Preconditions
- checkNotNull(T) - Static method in class com.google.gson.internal.$Gson$Preconditions
- CLASS - Static variable in class com.google.gson.internal.bind.TypeAdapters
- CLASS_FACTORY - Static variable in class com.google.gson.internal.bind.TypeAdapters
- clear() - Method in class com.google.gson.internal.LinkedHashTreeMap
- clear() - Method in class com.google.gson.internal.LinkedTreeMap
- clone() - Method in class com.google.gson.internal.Excluder
- close() - Method in class com.google.gson.internal.bind.JsonTreeReader
- close() - Method in class com.google.gson.internal.bind.JsonTreeWriter
- close() - Method in class com.google.gson.stream.JsonReader
-
Closes this JSON reader and the underlying
Reader
. - close() - Method in class com.google.gson.stream.JsonWriter
-
Flushes and closes this writer and the underlying
Writer
. - CollectionTypeAdapterFactory - Class in com.google.gson.internal.bind
-
Adapt a homogeneous collection of objects.
- CollectionTypeAdapterFactory(ConstructorConstructor) - Constructor for class com.google.gson.internal.bind.CollectionTypeAdapterFactory
- com.google.gson - package com.google.gson
-
This package provides the
Gson
class to convert Json to Java and vice-versa. - com.google.gson.annotations - package com.google.gson.annotations
-
This package provides annotations that can be used with
Gson
. - com.google.gson.extras.examples.rawcollections - package com.google.gson.extras.examples.rawcollections
- com.google.gson.graph - package com.google.gson.graph
- com.google.gson.interceptors - package com.google.gson.interceptors
- com.google.gson.internal - package com.google.gson.internal
-
Do NOT use any class in this package as they are meant for internal use in Gson.
- com.google.gson.internal.bind - package com.google.gson.internal.bind
- com.google.gson.internal.bind.util - package com.google.gson.internal.bind.util
- com.google.gson.internal.reflect - package com.google.gson.internal.reflect
- com.google.gson.internal.sql - package com.google.gson.internal.sql
- com.google.gson.reflect - package com.google.gson.reflect
-
This package provides utility classes for finding type information for generic types.
- com.google.gson.stream - package com.google.gson.stream
- com.google.gson.typeadapters - package com.google.gson.typeadapters
- construct() - Method in interface com.google.gson.internal.ObjectConstructor
-
Returns a new instance.
- ConstructorConstructor - Class in com.google.gson.internal
-
Returns a function that can construct an instance of a requested type.
- ConstructorConstructor(Map<Type, InstanceCreator<?>>) - Constructor for class com.google.gson.internal.ConstructorConstructor
- contains(JsonElement) - Method in class com.google.gson.JsonArray
-
Returns true if this array contains the specified element.
- containsKey(Object) - Method in class com.google.gson.internal.LinkedHashTreeMap
- containsKey(Object) - Method in class com.google.gson.internal.LinkedTreeMap
- create() - Method in class com.google.gson.GsonBuilder
-
Creates a
Gson
instance based on the current configuration. - create() - Static method in class com.google.gson.internal.UnsafeAllocator
- create(Gson, TypeToken<R>) - Method in class com.google.gson.typeadapters.RuntimeTypeAdapterFactory
- create(Gson, TypeToken<T>) - Method in class com.google.gson.interceptors.InterceptorFactory
- create(Gson, TypeToken<T>) - Method in class com.google.gson.internal.bind.CollectionTypeAdapterFactory
- create(Gson, TypeToken<T>) - Method in class com.google.gson.internal.bind.JsonAdapterAnnotationTypeAdapterFactory
- create(Gson, TypeToken<T>) - Method in class com.google.gson.internal.bind.MapTypeAdapterFactory
- create(Gson, TypeToken<T>) - Method in class com.google.gson.internal.bind.ReflectiveTypeAdapterFactory
- create(Gson, TypeToken<T>) - Method in class com.google.gson.internal.Excluder
- create(Gson, TypeToken<T>) - Method in interface com.google.gson.TypeAdapterFactory
-
Returns a type adapter for
type
, or null if this factory doesn't supporttype
. - create(Gson, TypeToken<T>) - Method in class com.google.gson.typeadapters.PostConstructAdapterFactory
- createAdapterFactory(int) - Method in class com.google.gson.internal.bind.DefaultDateTypeAdapter.DateType
- createAdapterFactory(int, int) - Method in class com.google.gson.internal.bind.DefaultDateTypeAdapter.DateType
- createAdapterFactory(String) - Method in class com.google.gson.internal.bind.DefaultDateTypeAdapter.DateType
- createDefaultsAdapterFactory() - Method in class com.google.gson.internal.bind.DefaultDateTypeAdapter.DateType
- createInstance(Type) - Method in interface com.google.gson.InstanceCreator
-
Gson invokes this call-back method during deserialization to create an instance of the specified type.
- CURRENCY - Static variable in class com.google.gson.internal.bind.TypeAdapters
- CURRENCY_FACTORY - Static variable in class com.google.gson.internal.bind.TypeAdapters
D
- DATE - Static variable in class com.google.gson.internal.bind.DefaultDateTypeAdapter.DateType
- DATE_DATE_TYPE - Static variable in class com.google.gson.internal.sql.SqlTypesSupport
- DATE_FACTORY - Static variable in class com.google.gson.internal.sql.SqlTypesSupport
- DateType(Class<T>) - Constructor for class com.google.gson.internal.bind.DefaultDateTypeAdapter.DateType
- DateTypeAdapter - Class in com.google.gson.internal.bind
-
Adapter for Date.
- DateTypeAdapter() - Constructor for class com.google.gson.internal.bind.DateTypeAdapter
- deepCopy() - Method in class com.google.gson.JsonArray
-
Creates a deep copy of this element and all its children
- deepCopy() - Method in class com.google.gson.JsonElement
-
Returns a deep copy of this element.
- deepCopy() - Method in class com.google.gson.JsonNull
-
Returns the same instance since it is an immutable value
- deepCopy() - Method in class com.google.gson.JsonObject
-
Creates a deep copy of this element and all its children
- deepCopy() - Method in class com.google.gson.JsonPrimitive
-
Returns the same value as primitives are immutable.
- DEFAULT - com.google.gson.LongSerializationPolicy
-
This is the "default" serialization policy that will output a
Long
object as a JSON number. - DEFAULT - Static variable in class com.google.gson.internal.Excluder
- DefaultDateTypeAdapter<T extends Date> - Class in com.google.gson.internal.bind
-
This type adapter supports subclasses of date by defining a
DefaultDateTypeAdapter.DateType
and then using itscreateAdapterFactory
methods. - DefaultDateTypeAdapter.DateType<T extends Date> - Class in com.google.gson.internal.bind
- deserialize() - Method in annotation type com.google.gson.annotations.Expose
-
If
true
, the field marked with this annotation is deserialized from the JSON. - deserialize(JsonElement, Type) - Method in interface com.google.gson.JsonDeserializationContext
-
Invokes default deserialization on the specified object.
- deserialize(JsonElement, Type, JsonDeserializationContext) - Method in interface com.google.gson.JsonDeserializer
-
Gson invokes this call-back method during deserialization when it encounters a field of the specified type.
- deserialize(Date) - Method in class com.google.gson.internal.bind.DefaultDateTypeAdapter.DateType
- disableHtmlEscaping() - Method in class com.google.gson.GsonBuilder
-
By default, Gson escapes HTML characters such as < > etc.
- disableInnerClassSerialization() - Method in class com.google.gson.GsonBuilder
-
Configures Gson to exclude inner classes during serialization.
- disableInnerClassSerialization() - Method in class com.google.gson.internal.Excluder
- DOUBLE - com.google.gson.ToNumberPolicy
-
Using this policy will ensure that numbers will be read as
Double
values. - DOUBLE - Static variable in class com.google.gson.internal.bind.TypeAdapters
- doubleValue() - Method in class com.google.gson.internal.LazilyParsedNumber
E
- enableComplexMapKeySerialization() - Method in class com.google.gson.GsonBuilder
-
Enabling this feature will only change the serialized form if the map key is a complex type (i.e.
- END_ARRAY - com.google.gson.stream.JsonToken
-
The closing of a JSON array.
- END_DOCUMENT - com.google.gson.stream.JsonToken
-
The end of the JSON stream.
- END_OBJECT - com.google.gson.stream.JsonToken
-
The closing of a JSON object.
- endArray() - Method in class com.google.gson.internal.bind.JsonTreeReader
- endArray() - Method in class com.google.gson.internal.bind.JsonTreeWriter
- endArray() - Method in class com.google.gson.stream.JsonReader
-
Consumes the next token from the JSON stream and asserts that it is the end of the current array.
- endArray() - Method in class com.google.gson.stream.JsonWriter
-
Ends encoding the current array.
- endObject() - Method in class com.google.gson.internal.bind.JsonTreeReader
- endObject() - Method in class com.google.gson.internal.bind.JsonTreeWriter
- endObject() - Method in class com.google.gson.stream.JsonReader
-
Consumes the next token from the JSON stream and asserts that it is the end of the current object.
- endObject() - Method in class com.google.gson.stream.JsonWriter
-
Ends encoding the current object.
- entrySet() - Method in class com.google.gson.internal.LinkedHashTreeMap
- entrySet() - Method in class com.google.gson.internal.LinkedTreeMap
- entrySet() - Method in class com.google.gson.JsonObject
-
Returns a set of members of this object.
- ENUM_FACTORY - Static variable in class com.google.gson.internal.bind.TypeAdapters
- equals(Object) - Method in class com.google.gson.internal.LazilyParsedNumber
- equals(Object) - Method in class com.google.gson.JsonArray
- equals(Object) - Method in class com.google.gson.JsonNull
-
All instances of JsonNull are the same
- equals(Object) - Method in class com.google.gson.JsonObject
- equals(Object) - Method in class com.google.gson.JsonPrimitive
- equals(Object) - Method in class com.google.gson.reflect.TypeToken
- equals(Type, Type) - Static method in class com.google.gson.internal.$Gson$Types
-
Returns true if
a
andb
are equal. - excludeClass(Class<?>, boolean) - Method in class com.google.gson.internal.Excluder
- excludeField(Field, boolean) - Method in class com.google.gson.internal.bind.ReflectiveTypeAdapterFactory
- excludeField(Field, boolean) - Method in class com.google.gson.internal.Excluder
- excludeFieldsWithModifiers(int...) - Method in class com.google.gson.GsonBuilder
-
Configures Gson to excludes all class fields that have the specified modifiers.
- excludeFieldsWithoutExposeAnnotation() - Method in class com.google.gson.GsonBuilder
-
Configures Gson to exclude all fields from consideration for serialization or deserialization that do not have the
Expose
annotation. - excludeFieldsWithoutExposeAnnotation() - Method in class com.google.gson.internal.Excluder
- excluder() - Method in class com.google.gson.Gson
-
Deprecated.This method by accident exposes an internal Gson class; it might be removed in a future version.
- Excluder - Class in com.google.gson.internal
-
This class selects which fields and types to omit.
- Excluder() - Constructor for class com.google.gson.internal.Excluder
- ExclusionStrategy - Interface in com.google.gson
-
A strategy (or policy) definition that is used to decide whether or not a field or top-level class should be serialized or deserialized as part of the JSON output/input.
- Expose - Annotation Type in com.google.gson.annotations
-
An annotation that indicates this member should be exposed for JSON serialization or deserialization.
F
- FACTORY - Static variable in class com.google.gson.internal.bind.ArrayTypeAdapter
- FACTORY - Static variable in class com.google.gson.internal.bind.DateTypeAdapter
- FieldAttributes - Class in com.google.gson
-
A data object that stores attributes of a field.
- FieldAttributes(Field) - Constructor for class com.google.gson.FieldAttributes
-
Constructs a Field Attributes object from the
f
. - FieldNamingPolicy - Enum in com.google.gson
-
An enumeration that defines a few standard naming conventions for JSON field names.
- fieldNamingStrategy() - Method in class com.google.gson.Gson
-
Returns the field naming strategy used by this Gson instance.
- FieldNamingStrategy - Interface in com.google.gson
-
A mechanism for providing custom field naming in Gson.
- FLOAT - Static variable in class com.google.gson.internal.bind.TypeAdapters
- floatValue() - Method in class com.google.gson.internal.LazilyParsedNumber
- flush() - Method in class com.google.gson.internal.bind.JsonTreeWriter
- flush() - Method in class com.google.gson.stream.JsonWriter
-
Ensures all buffered data is written to the underlying
Writer
and flushes that writer. - format(Date) - Static method in class com.google.gson.internal.bind.util.ISO8601Utils
-
Format a date into 'yyyy-MM-ddThh:mm:ssZ' (default timezone, no milliseconds precision)
- format(Date, boolean) - Static method in class com.google.gson.internal.bind.util.ISO8601Utils
-
Format a date into 'yyyy-MM-ddThh:mm:ss[.sss]Z' (GMT timezone)
- format(Date, boolean, TimeZone) - Static method in class com.google.gson.internal.bind.util.ISO8601Utils
-
Format date into yyyy-MM-ddThh:mm:ss[.sss][Z|[+-]hh:mm]
- fromJson(JsonElement, Class<T>) - Method in class com.google.gson.Gson
-
This method deserializes the Json read from the specified parse tree into an object of the specified type.
- fromJson(JsonElement, Type) - Method in class com.google.gson.Gson
-
This method deserializes the Json read from the specified parse tree into an object of the specified type.
- fromJson(JsonReader, Type) - Method in class com.google.gson.Gson
-
Reads the next JSON value from
reader
and convert it to an object of typetypeOfT
. - fromJson(Reader) - Method in class com.google.gson.TypeAdapter
-
Converts the JSON document in
in
to a Java object. - fromJson(Reader, Class<T>) - Method in class com.google.gson.Gson
-
This method deserializes the Json read from the specified reader into an object of the specified class.
- fromJson(Reader, Type) - Method in class com.google.gson.Gson
-
This method deserializes the Json read from the specified reader into an object of the specified type.
- fromJson(String) - Method in class com.google.gson.TypeAdapter
-
Converts the JSON document in
json
to a Java object. - fromJson(String, Class<T>) - Method in class com.google.gson.Gson
-
This method deserializes the specified Json into an object of the specified class.
- fromJson(String, Type) - Method in class com.google.gson.Gson
-
This method deserializes the specified Json into an object of the specified type.
- fromJsonTree(JsonElement) - Method in class com.google.gson.TypeAdapter
-
Converts
jsonTree
to a Java object.
G
- generateNonExecutableJson() - Method in class com.google.gson.GsonBuilder
-
Makes the output JSON non-executable in Javascript by prefixing the generated JSON with some special text.
- get() - Method in class com.google.gson.internal.bind.JsonTreeWriter
-
Returns the top level object produced by this writer.
- get(int) - Method in class com.google.gson.JsonArray
-
Returns the ith element of the array.
- get(TypeToken<T>) - Method in class com.google.gson.internal.ConstructorConstructor
- get(Class<T>) - Static method in class com.google.gson.reflect.TypeToken
-
Gets type literal for the given
Class
instance. - get(Object) - Method in class com.google.gson.internal.LinkedHashTreeMap
- get(Object) - Method in class com.google.gson.internal.LinkedTreeMap
- get(Type) - Static method in class com.google.gson.reflect.TypeToken
-
Gets type literal for the given
Type
instance. - get(String) - Method in class com.google.gson.JsonObject
-
Returns the member with the specified name.
- getAdapter(TypeToken<T>) - Method in class com.google.gson.Gson
-
Returns the type adapter for type.
- getAdapter(Class<T>) - Method in class com.google.gson.Gson
-
Returns the type adapter for type.
- getAnnotation(Class<T>) - Method in class com.google.gson.FieldAttributes
-
Return the
T
annotation object from this field if it exist; otherwise returnsnull
. - getAnnotations() - Method in class com.google.gson.FieldAttributes
-
Return the annotations that are present on this field.
- getArray(Type) - Static method in class com.google.gson.reflect.TypeToken
-
Gets type literal for the array type whose elements are all instances of
componentType
. - getArrayComponentType(Type) - Static method in class com.google.gson.internal.$Gson$Types
-
Returns the component type of this array type.
- getAsBigDecimal() - Method in class com.google.gson.JsonArray
-
convenience method to get this array as a
BigDecimal
if it contains a single element. - getAsBigDecimal() - Method in class com.google.gson.JsonElement
-
convenience method to get this element as a
BigDecimal
. - getAsBigDecimal() - Method in class com.google.gson.JsonPrimitive
-
convenience method to get this element as a
BigDecimal
. - getAsBigInteger() - Method in class com.google.gson.JsonArray
-
convenience method to get this array as a
BigInteger
if it contains a single element. - getAsBigInteger() - Method in class com.google.gson.JsonElement
-
convenience method to get this element as a
BigInteger
. - getAsBigInteger() - Method in class com.google.gson.JsonPrimitive
-
convenience method to get this element as a
BigInteger
. - getAsBoolean() - Method in class com.google.gson.JsonArray
-
convenience method to get this array as a boolean if it contains a single element.
- getAsBoolean() - Method in class com.google.gson.JsonElement
-
convenience method to get this element as a boolean value.
- getAsBoolean() - Method in class com.google.gson.JsonPrimitive
-
convenience method to get this element as a boolean value.
- getAsByte() - Method in class com.google.gson.JsonArray
- getAsByte() - Method in class com.google.gson.JsonElement
-
convenience method to get this element as a primitive byte value.
- getAsByte() - Method in class com.google.gson.JsonPrimitive
- getAsCharacter() - Method in class com.google.gson.JsonArray
- getAsCharacter() - Method in class com.google.gson.JsonElement
-
Deprecated.This method is misleading, as it does not get this element as a char but rather as a string's first character.
- getAsCharacter() - Method in class com.google.gson.JsonPrimitive
- getAsDouble() - Method in class com.google.gson.JsonArray
-
convenience method to get this array as a double if it contains a single element.
- getAsDouble() - Method in class com.google.gson.JsonElement
-
convenience method to get this element as a primitive double value.
- getAsDouble() - Method in class com.google.gson.JsonPrimitive
-
convenience method to get this element as a primitive double.
- getAsFloat() - Method in class com.google.gson.JsonArray
-
convenience method to get this array as a float if it contains a single element.
- getAsFloat() - Method in class com.google.gson.JsonElement
-
convenience method to get this element as a primitive float value.
- getAsFloat() - Method in class com.google.gson.JsonPrimitive
-
convenience method to get this element as a float.
- getAsInt() - Method in class com.google.gson.JsonArray
-
convenience method to get this array as an integer if it contains a single element.
- getAsInt() - Method in class com.google.gson.JsonElement
-
convenience method to get this element as a primitive integer value.
- getAsInt() - Method in class com.google.gson.JsonPrimitive
-
convenience method to get this element as a primitive integer.
- getAsJsonArray() - Method in class com.google.gson.JsonElement
-
convenience method to get this element as a
JsonArray
. - getAsJsonArray(String) - Method in class com.google.gson.JsonObject
-
Convenience method to get the specified member as a JsonArray.
- getAsJsonNull() - Method in class com.google.gson.JsonElement
-
convenience method to get this element as a
JsonNull
. - getAsJsonObject() - Method in class com.google.gson.JsonElement
-
convenience method to get this element as a
JsonObject
. - getAsJsonObject(String) - Method in class com.google.gson.JsonObject
-
Convenience method to get the specified member as a JsonObject.
- getAsJsonPrimitive() - Method in class com.google.gson.JsonElement
-
convenience method to get this element as a
JsonPrimitive
. - getAsJsonPrimitive(String) - Method in class com.google.gson.JsonObject
-
Convenience method to get the specified member as a JsonPrimitive element.
- getAsLong() - Method in class com.google.gson.JsonArray
-
convenience method to get this array as a long if it contains a single element.
- getAsLong() - Method in class com.google.gson.JsonElement
-
convenience method to get this element as a primitive long value.
- getAsLong() - Method in class com.google.gson.JsonPrimitive
-
convenience method to get this element as a primitive long.
- getAsNumber() - Method in class com.google.gson.JsonArray
-
convenience method to get this array as a
Number
if it contains a single element. - getAsNumber() - Method in class com.google.gson.JsonElement
-
convenience method to get this element as a
Number
. - getAsNumber() - Method in class com.google.gson.JsonPrimitive
-
convenience method to get this element as a Number.
- getAsShort() - Method in class com.google.gson.JsonArray
-
convenience method to get this array as a primitive short if it contains a single element.
- getAsShort() - Method in class com.google.gson.JsonElement
-
convenience method to get this element as a primitive short value.
- getAsShort() - Method in class com.google.gson.JsonPrimitive
-
convenience method to get this element as a primitive short.
- getAsString() - Method in class com.google.gson.JsonArray
-
convenience method to get this array as a
String
if it contains a single element. - getAsString() - Method in class com.google.gson.JsonElement
-
convenience method to get this element as a string value.
- getAsString() - Method in class com.google.gson.JsonPrimitive
-
convenience method to get this element as a String.
- getCollectionElementType(Type, Class<?>) - Static method in class com.google.gson.internal.$Gson$Types
-
Returns the element type of this collection type.
- getDeclaredClass() - Method in class com.google.gson.FieldAttributes
-
Returns the
Class
object that was declared for this field. - getDeclaredType() - Method in class com.google.gson.FieldAttributes
-
For example, assume the following class definition:
- getDeclaringClass() - Method in class com.google.gson.FieldAttributes
- getDelegateAdapter(TypeAdapterFactory, TypeToken<T>) - Method in class com.google.gson.Gson
-
This method is used to get an alternate type adapter for the specified type.
- getFactory(ToNumberStrategy) - Static method in class com.google.gson.internal.bind.NumberTypeAdapter
- getFactory(ToNumberStrategy) - Static method in class com.google.gson.internal.bind.ObjectTypeAdapter
- getInstance() - Static method in class com.google.gson.internal.reflect.ReflectionAccessor
-
Obtains a
ReflectionAccessor
instance suitable for the current Java version. - getMajorJavaVersion() - Static method in class com.google.gson.internal.JavaVersion
- getMapKeyAndValueTypes(Type, Class<?>) - Static method in class com.google.gson.internal.$Gson$Types
-
Returns a two element array containing this map's key and value types in positions 0 and 1 respectively.
- getName() - Method in class com.google.gson.FieldAttributes
- getParameterized(Type, Type...) - Static method in class com.google.gson.reflect.TypeToken
-
Gets type literal for the parameterized type represented by applying
typeArguments
torawType
. - getPath() - Method in class com.google.gson.internal.bind.JsonTreeReader
- getPath() - Method in class com.google.gson.stream.JsonReader
-
Returns a JsonPath to the current location in the JSON value.
- getRawType() - Method in class com.google.gson.reflect.TypeToken
-
Returns the raw (non-generic) type for this type.
- getRawType(Type) - Static method in class com.google.gson.internal.$Gson$Types
- getSerializeNulls() - Method in class com.google.gson.stream.JsonWriter
-
Returns true if object members are serialized when their value is null.
- getType() - Method in class com.google.gson.reflect.TypeToken
-
Gets underlying
Type
instance. - getUSDateFormat(int) - Static method in class com.google.gson.internal.PreJava9DateFormatProvider
-
Returns the same DateFormat as
DateFormat.getDateInstance(style, Locale.US)
in Java 8 or below. - getUSDateTimeFormat(int, int) - Static method in class com.google.gson.internal.PreJava9DateFormatProvider
-
Returns the same DateFormat as
DateFormat.getDateTimeInstance(dateStyle, timeStyle, Locale.US)
in Java 8 or below. - GraphAdapterBuilder - Class in com.google.gson.graph
-
Writes a graph of objects as a list of named nodes.
- GraphAdapterBuilder() - Constructor for class com.google.gson.graph.GraphAdapterBuilder
- Gson - Class in com.google.gson
-
This is the main class for using Gson.
- Gson() - Constructor for class com.google.gson.Gson
-
Constructs a Gson object with default configuration.
- GsonBuilder - Class in com.google.gson
-
Use this builder to construct a
Gson
instance when you need to set configuration options other than the default. - GsonBuilder() - Constructor for class com.google.gson.GsonBuilder
-
Creates a GsonBuilder instance that can be used to build Gson with various configuration settings.
H
- has(String) - Method in class com.google.gson.JsonObject
-
Convenience method to check if a member with the specified name is present in this object.
- hashCode() - Method in class com.google.gson.internal.LazilyParsedNumber
- hashCode() - Method in class com.google.gson.JsonArray
- hashCode() - Method in class com.google.gson.JsonNull
-
All instances of JsonNull have the same hash code since they are indistinguishable
- hashCode() - Method in class com.google.gson.JsonObject
- hashCode() - Method in class com.google.gson.JsonPrimitive
- hashCode() - Method in class com.google.gson.reflect.TypeToken
- hasModifier(int) - Method in class com.google.gson.FieldAttributes
-
Returns
true
if the field is defined with themodifier
. - hasNext() - Method in class com.google.gson.internal.bind.JsonTreeReader
- hasNext() - Method in class com.google.gson.JsonStreamParser
-
Returns true if a
JsonElement
is available on the input for consumption - hasNext() - Method in class com.google.gson.stream.JsonReader
-
Returns true if the current array or object has another element.
- htmlSafe() - Method in class com.google.gson.Gson
-
Returns whether this Gson instance produces JSON output which is HTML-safe, that means all HTML characters are escaped.
I
- IDENTITY - com.google.gson.FieldNamingPolicy
-
Using this naming policy with Gson will ensure that the field name is unchanged.
- INET_ADDRESS - Static variable in class com.google.gson.internal.bind.TypeAdapters
- INET_ADDRESS_FACTORY - Static variable in class com.google.gson.internal.bind.TypeAdapters
- INSTANCE - Static variable in class com.google.gson.internal.JsonReaderInternalAccess
- INSTANCE - Static variable in class com.google.gson.JsonNull
-
singleton for JsonNull
- InstanceCreator<T> - Interface in com.google.gson
-
This interface is implemented to create instances of a class that does not define a no-args constructor.
- INTEGER - Static variable in class com.google.gson.internal.bind.TypeAdapters
- INTEGER_FACTORY - Static variable in class com.google.gson.internal.bind.TypeAdapters
- Intercept - Annotation Type in com.google.gson.interceptors
-
Use this annotation to indicate various interceptors for class instances after they have been processed by Gson.
- InterceptorFactory - Class in com.google.gson.interceptors
-
A type adapter factory that implements
@Intercept
. - InterceptorFactory() - Constructor for class com.google.gson.interceptors.InterceptorFactory
- intValue() - Method in class com.google.gson.internal.LazilyParsedNumber
- isAssignableFrom(TypeToken<?>) - Method in class com.google.gson.reflect.TypeToken
-
Deprecated.this implementation may be inconsistent with javac for types with wildcards.
- isAssignableFrom(Class<?>) - Method in class com.google.gson.reflect.TypeToken
-
Deprecated.this implementation may be inconsistent with javac for types with wildcards.
- isAssignableFrom(Type) - Method in class com.google.gson.reflect.TypeToken
-
Deprecated.this implementation may be inconsistent with javac for types with wildcards.
- isBoolean() - Method in class com.google.gson.JsonPrimitive
-
Check whether this primitive contains a boolean value.
- isEmpty() - Method in class com.google.gson.JsonArray
-
Returns true if the array is empty
- isHtmlSafe() - Method in class com.google.gson.stream.JsonWriter
-
Returns true if this writer writes JSON that's safe for inclusion in HTML and XML documents.
- isJava9OrLater() - Static method in class com.google.gson.internal.JavaVersion
- isJsonArray() - Method in class com.google.gson.JsonElement
-
provides check for verifying if this element is an array or not.
- isJsonNull() - Method in class com.google.gson.JsonElement
-
provides check for verifying if this element represents a null value or not.
- isJsonObject() - Method in class com.google.gson.JsonElement
-
provides check for verifying if this element is a Json object or not.
- isJsonPrimitive() - Method in class com.google.gson.JsonElement
-
provides check for verifying if this element is a primitive or not.
- isLenient() - Method in class com.google.gson.stream.JsonReader
-
Returns true if this parser is liberal in what it accepts.
- isLenient() - Method in class com.google.gson.stream.JsonWriter
-
Returns true if this writer has relaxed syntax rules.
- isNumber() - Method in class com.google.gson.JsonPrimitive
-
Check whether this primitive contains a Number.
- ISO8601Utils - Class in com.google.gson.internal.bind.util
-
Utilities methods for manipulating dates in iso8601 format.
- ISO8601Utils() - Constructor for class com.google.gson.internal.bind.util.ISO8601Utils
- isPrimitive(Type) - Static method in class com.google.gson.internal.Primitives
-
Returns true if this type is a primitive.
- isString() - Method in class com.google.gson.JsonPrimitive
-
Check whether this primitive contains a String value.
- isWrapperType(Type) - Static method in class com.google.gson.internal.Primitives
- iterator() - Method in class com.google.gson.JsonArray
-
Returns an iterator to navigate the elements of the array.
J
- JavaVersion - Class in com.google.gson.internal
-
Utility to check the major Java version of the current JVM.
- JSON_ELEMENT - Static variable in class com.google.gson.internal.bind.TypeAdapters
- JSON_ELEMENT_FACTORY - Static variable in class com.google.gson.internal.bind.TypeAdapters
- JsonAdapter - Annotation Type in com.google.gson.annotations
-
An annotation that indicates the Gson
TypeAdapter
to use with a class or field. - JsonAdapterAnnotationTypeAdapterFactory - Class in com.google.gson.internal.bind
-
Given a type T, looks for the annotation
JsonAdapter
and uses an instance of the specified class as the default type adapter. - JsonAdapterAnnotationTypeAdapterFactory(ConstructorConstructor) - Constructor for class com.google.gson.internal.bind.JsonAdapterAnnotationTypeAdapterFactory
- JsonArray - Class in com.google.gson
-
A class representing an array type in Json.
- JsonArray() - Constructor for class com.google.gson.JsonArray
-
Creates an empty JsonArray.
- JsonArray(int) - Constructor for class com.google.gson.JsonArray
- JsonDeserializationContext - Interface in com.google.gson
-
Context for deserialization that is passed to a custom deserializer during invocation of its
JsonDeserializer.deserialize(JsonElement, Type, JsonDeserializationContext)
method. - JsonDeserializer<T> - Interface in com.google.gson
-
Interface representing a custom deserializer for Json.
- JsonElement - Class in com.google.gson
-
A class representing an element of Json.
- JsonElement() - Constructor for class com.google.gson.JsonElement
- JsonIOException - Exception in com.google.gson
-
This exception is raised when Gson was unable to read an input stream or write to one.
- JsonIOException(String) - Constructor for exception com.google.gson.JsonIOException
- JsonIOException(String, Throwable) - Constructor for exception com.google.gson.JsonIOException
- JsonIOException(Throwable) - Constructor for exception com.google.gson.JsonIOException
-
Creates exception with the specified cause.
- JsonNull - Class in com.google.gson
-
A class representing a Json
null
value. - JsonNull() - Constructor for class com.google.gson.JsonNull
-
Deprecated.
- JsonObject - Class in com.google.gson
-
A class representing an object type in Json.
- JsonObject() - Constructor for class com.google.gson.JsonObject
- JsonParseException - Exception in com.google.gson
-
This exception is raised if there is a serious issue that occurs during parsing of a Json string.
- JsonParseException(String) - Constructor for exception com.google.gson.JsonParseException
-
Creates exception with the specified message.
- JsonParseException(String, Throwable) - Constructor for exception com.google.gson.JsonParseException
-
Creates exception with the specified message and cause.
- JsonParseException(Throwable) - Constructor for exception com.google.gson.JsonParseException
-
Creates exception with the specified cause.
- JsonParser - Class in com.google.gson
-
A parser to parse Json into a parse tree of
JsonElement
s - JsonParser() - Constructor for class com.google.gson.JsonParser
-
Deprecated.No need to instantiate this class, use the static methods instead.
- JsonPostDeserializer<T> - Interface in com.google.gson.interceptors
-
This interface is implemented by a class that wishes to inspect or modify an object after it has been deserialized.
- JsonPrimitive - Class in com.google.gson
-
A class representing a Json primitive value.
- JsonPrimitive(Boolean) - Constructor for class com.google.gson.JsonPrimitive
-
Create a primitive containing a boolean value.
- JsonPrimitive(Character) - Constructor for class com.google.gson.JsonPrimitive
-
Create a primitive containing a character.
- JsonPrimitive(Number) - Constructor for class com.google.gson.JsonPrimitive
-
Create a primitive containing a
Number
. - JsonPrimitive(String) - Constructor for class com.google.gson.JsonPrimitive
-
Create a primitive containing a String value.
- JsonReader - Class in com.google.gson.stream
-
Reads a JSON (RFC 7159) encoded value as a stream of tokens.
- JsonReader(Reader) - Constructor for class com.google.gson.stream.JsonReader
-
Creates a new instance that reads a JSON-encoded stream from
in
. - JsonReaderInternalAccess - Class in com.google.gson.internal
-
Internal-only APIs of JsonReader available only to other classes in Gson.
- JsonReaderInternalAccess() - Constructor for class com.google.gson.internal.JsonReaderInternalAccess
- JsonSerializationContext - Interface in com.google.gson
-
Context for serialization that is passed to a custom serializer during invocation of its
JsonSerializer.serialize(Object, Type, JsonSerializationContext)
method. - JsonSerializer<T> - Interface in com.google.gson
-
Interface representing a custom serializer for Json.
- JsonStreamParser - Class in com.google.gson
-
A streaming parser that allows reading of multiple
JsonElement
s from the specified reader asynchronously. - JsonStreamParser(Reader) - Constructor for class com.google.gson.JsonStreamParser
- JsonStreamParser(String) - Constructor for class com.google.gson.JsonStreamParser
- JsonSyntaxException - Exception in com.google.gson
-
This exception is raised when Gson attempts to read (or write) a malformed JSON element.
- JsonSyntaxException(String) - Constructor for exception com.google.gson.JsonSyntaxException
- JsonSyntaxException(String, Throwable) - Constructor for exception com.google.gson.JsonSyntaxException
- JsonSyntaxException(Throwable) - Constructor for exception com.google.gson.JsonSyntaxException
-
Creates exception with the specified cause.
- JsonToken - Enum in com.google.gson.stream
-
A structure, name or value type in a JSON-encoded string.
- JsonTreeReader - Class in com.google.gson.internal.bind
-
This reader walks the elements of a JsonElement as if it was coming from a character stream.
- JsonTreeReader(JsonElement) - Constructor for class com.google.gson.internal.bind.JsonTreeReader
- JsonTreeWriter - Class in com.google.gson.internal.bind
-
This writer creates a JsonElement.
- JsonTreeWriter() - Constructor for class com.google.gson.internal.bind.JsonTreeWriter
- jsonValue(String) - Method in class com.google.gson.stream.JsonWriter
-
Writes
value
directly to the writer without quoting or escaping. - JsonWriter - Class in com.google.gson.stream
-
Writes a JSON (RFC 7159) encoded value to a stream, one token at a time.
- JsonWriter(Writer) - Constructor for class com.google.gson.stream.JsonWriter
-
Creates a new instance that writes a JSON-encoded stream to
out
.
K
- keySet() - Method in class com.google.gson.internal.LinkedHashTreeMap
- keySet() - Method in class com.google.gson.internal.LinkedTreeMap
- keySet() - Method in class com.google.gson.JsonObject
-
Returns a set of members key values.
L
- LAZILY_PARSED_NUMBER - com.google.gson.ToNumberPolicy
-
Using this policy will ensure that numbers will be read as a lazily parsed number backed by a string.
- LazilyParsedNumber - Class in com.google.gson.internal
-
This class holds a number value that is lazily converted to a specific number type
- LazilyParsedNumber(String) - Constructor for class com.google.gson.internal.LazilyParsedNumber
- LinkedHashTreeMap<K,V> - Class in com.google.gson.internal
-
A map of comparable keys to values.
- LinkedHashTreeMap() - Constructor for class com.google.gson.internal.LinkedHashTreeMap
-
Create a natural order, empty tree map whose keys must be mutually comparable and non-null.
- LinkedHashTreeMap(Comparator<? super K>) - Constructor for class com.google.gson.internal.LinkedHashTreeMap
-
Create a tree map ordered by
comparator
. - LinkedTreeMap<K,V> - Class in com.google.gson.internal
-
A map of comparable keys to values.
- LinkedTreeMap() - Constructor for class com.google.gson.internal.LinkedTreeMap
-
Create a natural order, empty tree map whose keys must be mutually comparable and non-null.
- LinkedTreeMap(Comparator<? super K>) - Constructor for class com.google.gson.internal.LinkedTreeMap
-
Create a tree map ordered by
comparator
. - LOCALE - Static variable in class com.google.gson.internal.bind.TypeAdapters
- LOCALE_FACTORY - Static variable in class com.google.gson.internal.bind.TypeAdapters
- LONG - Static variable in class com.google.gson.internal.bind.TypeAdapters
- LONG_OR_DOUBLE - com.google.gson.ToNumberPolicy
- LongSerializationPolicy - Enum in com.google.gson
-
Defines the expected format for a
long
orLong
type when it is serialized. - longValue() - Method in class com.google.gson.internal.LazilyParsedNumber
- LOWER_CASE_WITH_DASHES - com.google.gson.FieldNamingPolicy
-
Using this naming policy with Gson will modify the Java Field name from its camel cased form to a lower case field name where each word is separated by a dash (-).
- LOWER_CASE_WITH_DOTS - com.google.gson.FieldNamingPolicy
-
Using this naming policy with Gson will modify the Java Field name from its camel cased form to a lower case field name where each word is separated by a dot (.).
- LOWER_CASE_WITH_UNDERSCORES - com.google.gson.FieldNamingPolicy
-
Using this naming policy with Gson will modify the Java Field name from its camel cased form to a lower case field name where each word is separated by an underscore (_).
M
- main(String[]) - Static method in class com.google.gson.extras.examples.rawcollections.RawCollectionsExample
- makeAccessible(AccessibleObject) - Method in class com.google.gson.internal.reflect.ReflectionAccessor
-
Does the same as
ao.setAccessible(true)
, but never throwsInaccessibleObjectException
- MalformedJsonException - Exception in com.google.gson.stream
-
Thrown when a reader encounters malformed JSON.
- MalformedJsonException(String) - Constructor for exception com.google.gson.stream.MalformedJsonException
- MalformedJsonException(String, Throwable) - Constructor for exception com.google.gson.stream.MalformedJsonException
- MalformedJsonException(Throwable) - Constructor for exception com.google.gson.stream.MalformedJsonException
- MapTypeAdapterFactory - Class in com.google.gson.internal.bind
-
Adapts maps to either JSON objects or JSON arrays.
- MapTypeAdapterFactory(ConstructorConstructor, boolean) - Constructor for class com.google.gson.internal.bind.MapTypeAdapterFactory
N
- name(String) - Method in class com.google.gson.internal.bind.JsonTreeWriter
- name(String) - Method in class com.google.gson.stream.JsonWriter
-
Encodes the property name.
- NAME - com.google.gson.stream.JsonToken
-
A JSON property name.
- newBuilder() - Method in class com.google.gson.Gson
-
Returns a new GsonBuilder containing all custom factories and configuration used by the current instance.
- newFactory(TypeToken<?>, Object) - Static method in class com.google.gson.internal.bind.TreeTypeAdapter
-
Returns a new factory that will match each type against
exactType
. - newFactory(TypeToken<TT>, TypeAdapter<TT>) - Static method in class com.google.gson.internal.bind.TypeAdapters
- newFactory(Class<TT>, TypeAdapter<TT>) - Static method in class com.google.gson.internal.bind.TypeAdapters
- newFactory(Class<TT>, Class<TT>, TypeAdapter<? super TT>) - Static method in class com.google.gson.internal.bind.TypeAdapters
- newFactoryForMultipleTypes(Class<TT>, Class<? extends TT>, TypeAdapter<? super TT>) - Static method in class com.google.gson.internal.bind.TypeAdapters
- newFactoryWithMatchRawType(TypeToken<?>, Object) - Static method in class com.google.gson.internal.bind.TreeTypeAdapter
-
Returns a new factory that will match each type and its raw type against
exactType
. - newInstance(Class<T>) - Method in class com.google.gson.internal.UnsafeAllocator
- newJsonReader(Reader) - Method in class com.google.gson.Gson
-
Returns a new JSON reader configured for the settings on this Gson instance.
- newJsonWriter(Writer) - Method in class com.google.gson.Gson
-
Returns a new JSON writer configured for the settings on this Gson instance.
- newParameterizedTypeWithOwner(Type, Type, Type...) - Static method in class com.google.gson.internal.$Gson$Types
-
Returns a new parameterized type, applying
typeArguments
torawType
and enclosed byownerType
. - newTypeHierarchyFactory(Class<?>, Object) - Static method in class com.google.gson.internal.bind.TreeTypeAdapter
-
Returns a new factory that will match each type's raw type for assignability to
hierarchyType
. - newTypeHierarchyFactory(Class<T1>, TypeAdapter<T1>) - Static method in class com.google.gson.internal.bind.TypeAdapters
-
Returns a factory for all subtypes of
typeAdapter
. - next() - Method in class com.google.gson.JsonStreamParser
-
Returns the next available
JsonElement
on the reader. - nextBoolean() - Method in class com.google.gson.internal.bind.JsonTreeReader
- nextBoolean() - Method in class com.google.gson.stream.JsonReader
-
Returns the
boolean
value of the next token, consuming it. - nextDouble() - Method in class com.google.gson.internal.bind.JsonTreeReader
- nextDouble() - Method in class com.google.gson.stream.JsonReader
-
Returns the
double
value of the next token, consuming it. - nextInt() - Method in class com.google.gson.internal.bind.JsonTreeReader
- nextInt() - Method in class com.google.gson.stream.JsonReader
-
Returns the
int
value of the next token, consuming it. - nextLong() - Method in class com.google.gson.internal.bind.JsonTreeReader
- nextLong() - Method in class com.google.gson.stream.JsonReader
-
Returns the
long
value of the next token, consuming it. - nextName() - Method in class com.google.gson.internal.bind.JsonTreeReader
- nextName() - Method in class com.google.gson.stream.JsonReader
-
Returns the next token, a
property name
, and consumes it. - nextNull() - Method in class com.google.gson.internal.bind.JsonTreeReader
- nextNull() - Method in class com.google.gson.stream.JsonReader
-
Consumes the next token from the JSON stream and asserts that it is a literal null.
- nextString() - Method in class com.google.gson.internal.bind.JsonTreeReader
- nextString() - Method in class com.google.gson.stream.JsonReader
-
Returns the
string
value of the next token, consuming it. - NULL - com.google.gson.stream.JsonToken
-
A JSON
null
. - nullSafe() - Method in annotation type com.google.gson.annotations.JsonAdapter
-
false, to be able to handle
null
values within the adapter, default value is true. - nullSafe() - Method in class com.google.gson.TypeAdapter
-
This wrapper method is used to make a type adapter null tolerant.
- nullValue() - Method in class com.google.gson.internal.bind.JsonTreeWriter
- nullValue() - Method in class com.google.gson.stream.JsonWriter
-
Encodes
null
. - NUMBER - com.google.gson.stream.JsonToken
-
A JSON number represented in this API by a Java
double
,long
, orint
. - NumberTypeAdapter - Class in com.google.gson.internal.bind
-
Type adapter for
Number
.
O
- ObjectConstructor<T> - Interface in com.google.gson.internal
-
Defines a generic object construction factory.
- ObjectTypeAdapter - Class in com.google.gson.internal.bind
-
Adapts types whose static type is only 'Object'.
- of(Class<T>) - Static method in class com.google.gson.typeadapters.RuntimeTypeAdapterFactory
-
Creates a new runtime type adapter for
baseType
using"type"
as the type field name. - of(Class<T>, String) - Static method in class com.google.gson.typeadapters.RuntimeTypeAdapterFactory
-
Creates a new runtime type adapter using for
baseType
usingtypeFieldName
as the type field name. - of(Class<T>, String, boolean) - Static method in class com.google.gson.typeadapters.RuntimeTypeAdapterFactory
-
Creates a new runtime type adapter using for
baseType
usingtypeFieldName
as the type field name.
P
- parse(JsonReader) - Static method in class com.google.gson.internal.Streams
-
Takes a reader in any state and returns the next value as a JsonElement.
- parse(JsonReader) - Method in class com.google.gson.JsonParser
-
Deprecated.
- parse(Reader) - Method in class com.google.gson.JsonParser
-
Deprecated.
- parse(String) - Method in class com.google.gson.JsonParser
-
Deprecated.
- parse(String, ParsePosition) - Static method in class com.google.gson.internal.bind.util.ISO8601Utils
-
Parse a date from ISO-8601 formatted string.
- parseReader(JsonReader) - Static method in class com.google.gson.JsonParser
-
Returns the next value from the JSON stream as a parse tree.
- parseReader(Reader) - Static method in class com.google.gson.JsonParser
-
Parses the specified JSON string into a parse tree
- parseString(String) - Static method in class com.google.gson.JsonParser
-
Parses the specified JSON string into a parse tree
- peek() - Method in class com.google.gson.internal.bind.JsonTreeReader
- peek() - Method in class com.google.gson.stream.JsonReader
-
Returns the type of the next token without consuming it.
- PostConstructAdapterFactory - Class in com.google.gson.typeadapters
- PostConstructAdapterFactory() - Constructor for class com.google.gson.typeadapters.PostConstructAdapterFactory
- postDeserialize() - Method in annotation type com.google.gson.interceptors.Intercept
-
Specify the class that provides the methods that should be invoked after an instance has been deserialized.
- postDeserialize(T) - Method in interface com.google.gson.interceptors.JsonPostDeserializer
-
This method is called by Gson after the object has been deserialized from Json.
- PreJava9DateFormatProvider - Class in com.google.gson.internal
-
Provides DateFormats for US locale with patterns which were the default ones before Java 9.
- PreJava9DateFormatProvider() - Constructor for class com.google.gson.internal.PreJava9DateFormatProvider
- Primitives - Class in com.google.gson.internal
-
Contains static utility methods pertaining to primitive types and their corresponding wrapper types.
- promoteNameToValue() - Method in class com.google.gson.internal.bind.JsonTreeReader
- promoteNameToValue(JsonReader) - Method in class com.google.gson.internal.JsonReaderInternalAccess
-
Changes the type of the current property name token to a string value.
- put(K, V) - Method in class com.google.gson.internal.LinkedHashTreeMap
- put(K, V) - Method in class com.google.gson.internal.LinkedTreeMap
R
- RawCollectionsExample - Class in com.google.gson.extras.examples.rawcollections
- RawCollectionsExample() - Constructor for class com.google.gson.extras.examples.rawcollections.RawCollectionsExample
- read(JsonReader) - Method in class com.google.gson.internal.bind.ArrayTypeAdapter
- read(JsonReader) - Method in class com.google.gson.internal.bind.DateTypeAdapter
- read(JsonReader) - Method in class com.google.gson.internal.bind.DefaultDateTypeAdapter
- read(JsonReader) - Method in class com.google.gson.internal.bind.NumberTypeAdapter
- read(JsonReader) - Method in class com.google.gson.internal.bind.ObjectTypeAdapter
- read(JsonReader) - Method in class com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.Adapter
- read(JsonReader) - Method in class com.google.gson.internal.bind.TreeTypeAdapter
- read(JsonReader) - Method in class com.google.gson.TypeAdapter
-
Reads one JSON value (an array, object, string, number, boolean or null) and converts it to a Java object.
- read(JsonReader) - Method in class com.google.gson.typeadapters.UtcDateTypeAdapter
- readNumber(JsonReader) - Method in interface com.google.gson.ToNumberStrategy
-
Reads a number from the given JSON reader.
- ReflectionAccessor - Class in com.google.gson.internal.reflect
-
Provides a replacement for
AccessibleObject.setAccessible(boolean)
, which may be used to avoid reflective access issues appeared in Java 9, likeInaccessibleObjectException
thrown or warnings like - ReflectionAccessor() - Constructor for class com.google.gson.internal.reflect.ReflectionAccessor
- ReflectiveTypeAdapterFactory - Class in com.google.gson.internal.bind
-
Type adapter that reflects over the fields and methods of a class.
- ReflectiveTypeAdapterFactory(ConstructorConstructor, FieldNamingStrategy, Excluder, JsonAdapterAnnotationTypeAdapterFactory) - Constructor for class com.google.gson.internal.bind.ReflectiveTypeAdapterFactory
- ReflectiveTypeAdapterFactory.Adapter<T> - Class in com.google.gson.internal.bind
- registerOn(GsonBuilder) - Method in class com.google.gson.graph.GraphAdapterBuilder
- registerSubtype(Class<? extends T>) - Method in class com.google.gson.typeadapters.RuntimeTypeAdapterFactory
-
Registers
type
identified by itssimple name
. - registerSubtype(Class<? extends T>, String) - Method in class com.google.gson.typeadapters.RuntimeTypeAdapterFactory
-
Registers
type
identified bylabel
. - registerTypeAdapter(Type, Object) - Method in class com.google.gson.GsonBuilder
-
Configures Gson for custom serialization or deserialization.
- registerTypeAdapterFactory(TypeAdapterFactory) - Method in class com.google.gson.GsonBuilder
-
Register a factory for type adapters.
- registerTypeHierarchyAdapter(Class<?>, Object) - Method in class com.google.gson.GsonBuilder
-
Configures Gson for custom serialization or deserialization for an inheritance type hierarchy.
- remove() - Method in class com.google.gson.JsonStreamParser
-
This optional
Iterator
method is not relevant for stream parsing and hence is not implemented. - remove(int) - Method in class com.google.gson.JsonArray
-
Removes the element at the specified position in this array.
- remove(JsonElement) - Method in class com.google.gson.JsonArray
-
Removes the first occurrence of the specified element from this array, if it is present.
- remove(Object) - Method in class com.google.gson.internal.LinkedHashTreeMap
- remove(Object) - Method in class com.google.gson.internal.LinkedTreeMap
- remove(String) - Method in class com.google.gson.JsonObject
-
Removes the
property
from thisJsonObject
. - resolve(Type, Class<?>, Type) - Static method in class com.google.gson.internal.$Gson$Types
- RuntimeTypeAdapterFactory<T> - Class in com.google.gson.typeadapters
-
Adapts values whose runtime type may differ from their declaration type.
S
- serialize() - Method in annotation type com.google.gson.annotations.Expose
-
If
true
, the field marked with this annotation is written out in the JSON while serializing. - serialize(Long) - Method in enum com.google.gson.LongSerializationPolicy
-
Serialize this
value
using this serialization policy. - serialize(Object) - Method in interface com.google.gson.JsonSerializationContext
-
Invokes default serialization on the specified object.
- serialize(Object, Type) - Method in interface com.google.gson.JsonSerializationContext
-
Invokes default serialization on the specified object passing the specific type information.
- serialize(T, Type, JsonSerializationContext) - Method in interface com.google.gson.JsonSerializer
-
Gson invokes this call-back method during serialization when it encounters a field of the specified type.
- SerializedName - Annotation Type in com.google.gson.annotations
-
An annotation that indicates this member should be serialized to JSON with the provided name value as its field name.
- serializeNulls() - Method in class com.google.gson.Gson
-
Returns whether this Gson instance is serializing JSON object properties with
null
values, or just omits them. - serializeNulls() - Method in class com.google.gson.GsonBuilder
-
Configure Gson to serialize null fields.
- serializeSpecialFloatingPointValues() - Method in class com.google.gson.GsonBuilder
-
Section 2.4 of JSON specification disallows special double values (NaN, Infinity, -Infinity).
- set(int, JsonElement) - Method in class com.google.gson.JsonArray
-
Replaces the element at the specified position in this array with the specified element.
- setDateFormat(int) - Method in class com.google.gson.GsonBuilder
-
Configures Gson to to serialize
Date
objects according to the style value provided. - setDateFormat(int, int) - Method in class com.google.gson.GsonBuilder
-
Configures Gson to to serialize
Date
objects according to the style value provided. - setDateFormat(String) - Method in class com.google.gson.GsonBuilder
-
Configures Gson to serialize
Date
objects according to the pattern provided. - setExclusionStrategies(ExclusionStrategy...) - Method in class com.google.gson.GsonBuilder
-
Configures Gson to apply a set of exclusion strategies during both serialization and deserialization.
- setFieldNamingPolicy(FieldNamingPolicy) - Method in class com.google.gson.GsonBuilder
-
Configures Gson to apply a specific naming policy to an object's field during serialization and deserialization.
- setFieldNamingStrategy(FieldNamingStrategy) - Method in class com.google.gson.GsonBuilder
-
Configures Gson to apply a specific naming policy strategy to an object's field during serialization and deserialization.
- setHtmlSafe(boolean) - Method in class com.google.gson.stream.JsonWriter
-
Configure this writer to emit JSON that's safe for direct inclusion in HTML and XML documents.
- setIndent(String) - Method in class com.google.gson.stream.JsonWriter
-
Sets the indentation string to be repeated for each level of indentation in the encoded document.
- setLenient() - Method in class com.google.gson.GsonBuilder
-
By default, Gson is strict and only accepts JSON as specified by RFC 4627.
- setLenient(boolean) - Method in class com.google.gson.stream.JsonReader
-
Configure this parser to be liberal in what it accepts.
- setLenient(boolean) - Method in class com.google.gson.stream.JsonWriter
-
Configure this writer to relax its syntax rules.
- setLongSerializationPolicy(LongSerializationPolicy) - Method in class com.google.gson.GsonBuilder
-
Configures Gson to apply a specific serialization policy for
Long
andlong
objects. - setNumberToNumberStrategy(ToNumberStrategy) - Method in class com.google.gson.GsonBuilder
-
Configures Gson to apply a specific number strategy during deserialization of
Number
. - setObjectToNumberStrategy(ToNumberStrategy) - Method in class com.google.gson.GsonBuilder
-
Configures Gson to apply a specific number strategy during deserialization of
Object
. - setPrettyPrinting() - Method in class com.google.gson.GsonBuilder
-
Configures Gson to output Json that fits in a page for pretty printing.
- setSerializeNulls(boolean) - Method in class com.google.gson.stream.JsonWriter
-
Sets whether object members are serialized when their value is null.
- setVersion(double) - Method in class com.google.gson.GsonBuilder
-
Configures Gson to enable versioning support.
- SHORT - Static variable in class com.google.gson.internal.bind.TypeAdapters
- SHORT_FACTORY - Static variable in class com.google.gson.internal.bind.TypeAdapters
- shouldSkipClass(Class<?>) - Method in interface com.google.gson.ExclusionStrategy
- shouldSkipField(FieldAttributes) - Method in interface com.google.gson.ExclusionStrategy
- Since - Annotation Type in com.google.gson.annotations
-
An annotation that indicates the version number since a member or a type has been present.
- size() - Method in class com.google.gson.internal.LinkedHashTreeMap
- size() - Method in class com.google.gson.internal.LinkedTreeMap
- size() - Method in class com.google.gson.JsonArray
-
Returns the number of elements in the array.
- size() - Method in class com.google.gson.JsonObject
-
Returns the number of key/value pairs in the object.
- skipValue() - Method in class com.google.gson.internal.bind.JsonTreeReader
- skipValue() - Method in class com.google.gson.stream.JsonReader
-
Skips the next value recursively.
- SqlTypesSupport - Class in com.google.gson.internal.sql
-
Encapsulates access to
java.sql
types, to allow Gson to work without thejava.sql
module being present. - Streams - Class in com.google.gson.internal
-
Reads and writes GSON parse trees over streams.
- STRING - com.google.gson.LongSerializationPolicy
-
Serializes a long value as a quoted string.
- STRING - com.google.gson.stream.JsonToken
-
A JSON string.
- STRING - Static variable in class com.google.gson.internal.bind.TypeAdapters
- STRING_BUFFER - Static variable in class com.google.gson.internal.bind.TypeAdapters
- STRING_BUFFER_FACTORY - Static variable in class com.google.gson.internal.bind.TypeAdapters
- STRING_BUILDER - Static variable in class com.google.gson.internal.bind.TypeAdapters
- STRING_BUILDER_FACTORY - Static variable in class com.google.gson.internal.bind.TypeAdapters
- STRING_FACTORY - Static variable in class com.google.gson.internal.bind.TypeAdapters
- subtypeOf(Type) - Static method in class com.google.gson.internal.$Gson$Types
-
Returns a type that represents an unknown type that extends
bound
. - supertypeOf(Type) - Static method in class com.google.gson.internal.$Gson$Types
-
Returns a type that represents an unknown supertype of
bound
. - SUPPORTS_SQL_TYPES - Static variable in class com.google.gson.internal.sql.SqlTypesSupport
-
true
ifjava.sql
types are supported,false
otherwise
T
- TIME_FACTORY - Static variable in class com.google.gson.internal.sql.SqlTypesSupport
- TIMESTAMP_DATE_TYPE - Static variable in class com.google.gson.internal.sql.SqlTypesSupport
- TIMESTAMP_FACTORY - Static variable in class com.google.gson.internal.sql.SqlTypesSupport
- toJson(JsonElement) - Method in class com.google.gson.Gson
-
Converts a tree of
JsonElement
s into its equivalent JSON representation. - toJson(JsonElement, JsonWriter) - Method in class com.google.gson.Gson
-
Writes the JSON for
jsonElement
towriter
. - toJson(JsonElement, Appendable) - Method in class com.google.gson.Gson
-
Writes out the equivalent JSON for a tree of
JsonElement
s. - toJson(Writer, T) - Method in class com.google.gson.TypeAdapter
-
Converts
value
to a JSON document and writes it toout
. - toJson(Object) - Method in class com.google.gson.Gson
-
This method serializes the specified object into its equivalent Json representation.
- toJson(Object, Appendable) - Method in class com.google.gson.Gson
-
This method serializes the specified object into its equivalent Json representation.
- toJson(Object, Type) - Method in class com.google.gson.Gson
-
This method serializes the specified object, including those of generic types, into its equivalent Json representation.
- toJson(Object, Type, JsonWriter) - Method in class com.google.gson.Gson
-
Writes the JSON representation of
src
of typetypeOfSrc
towriter
. - toJson(Object, Type, Appendable) - Method in class com.google.gson.Gson
-
This method serializes the specified object, including those of generic types, into its equivalent Json representation.
- toJson(T) - Method in class com.google.gson.TypeAdapter
-
Converts
value
to a JSON document. - toJsonTree(Object) - Method in class com.google.gson.Gson
-
This method serializes the specified object into its equivalent representation as a tree of
JsonElement
s. - toJsonTree(Object, Type) - Method in class com.google.gson.Gson
-
This method serializes the specified object, including those of generic types, into its equivalent representation as a tree of
JsonElement
s. - toJsonTree(T) - Method in class com.google.gson.TypeAdapter
-
Converts
value
to a JSON tree. - ToNumberPolicy - Enum in com.google.gson
- ToNumberStrategy - Interface in com.google.gson
- toString() - Method in class com.google.gson.Gson
- toString() - Method in class com.google.gson.internal.bind.DefaultDateTypeAdapter
- toString() - Method in class com.google.gson.internal.bind.JsonTreeReader
- toString() - Method in class com.google.gson.internal.ConstructorConstructor
- toString() - Method in class com.google.gson.internal.LazilyParsedNumber
- toString() - Method in class com.google.gson.JsonElement
-
Returns a String representation of this element.
- toString() - Method in class com.google.gson.reflect.TypeToken
- toString() - Method in class com.google.gson.stream.JsonReader
- translateName(Field) - Method in interface com.google.gson.FieldNamingStrategy
-
Translates the field name into its JSON field name representation.
- TreeTypeAdapter<T> - Class in com.google.gson.internal.bind
-
Adapts a Gson 1.x tree-style adapter as a streaming TypeAdapter.
- TreeTypeAdapter(JsonSerializer<T>, JsonDeserializer<T>, Gson, TypeToken<T>, TypeAdapterFactory) - Constructor for class com.google.gson.internal.bind.TreeTypeAdapter
- TypeAdapter<T> - Class in com.google.gson
-
Converts Java objects to and from JSON.
- TypeAdapter() - Constructor for class com.google.gson.TypeAdapter
- TypeAdapterFactory - Interface in com.google.gson
-
Creates type adapters for set of related types.
- TypeAdapters - Class in com.google.gson.internal.bind
-
Type adapters for basic types.
- TypeToken<T> - Class in com.google.gson.reflect
-
Represents a generic type
T
. - TypeToken() - Constructor for class com.google.gson.reflect.TypeToken
-
Constructs a new type literal.
- typeToString(Type) - Static method in class com.google.gson.internal.$Gson$Types
U
- UnsafeAllocator - Class in com.google.gson.internal
-
Do sneaky things to allocate objects without invoking their constructors.
- UnsafeAllocator() - Constructor for class com.google.gson.internal.UnsafeAllocator
- Until - Annotation Type in com.google.gson.annotations
-
An annotation that indicates the version number until a member or a type should be present.
- unwrap(Class<T>) - Static method in class com.google.gson.internal.Primitives
-
Returns the corresponding primitive type of
type
if it is a wrapper type; otherwise returnstype
itself. - UPPER_CAMEL_CASE - com.google.gson.FieldNamingPolicy
-
Using this naming policy with Gson will ensure that the first "letter" of the Java field name is capitalized when serialized to its JSON form.
- UPPER_CAMEL_CASE_WITH_SPACES - com.google.gson.FieldNamingPolicy
-
Using this naming policy with Gson will ensure that the first "letter" of the Java field name is capitalized when serialized to its JSON form and the words will be separated by a space.
- URI - Static variable in class com.google.gson.internal.bind.TypeAdapters
- URI_FACTORY - Static variable in class com.google.gson.internal.bind.TypeAdapters
- URL - Static variable in class com.google.gson.internal.bind.TypeAdapters
- URL_FACTORY - Static variable in class com.google.gson.internal.bind.TypeAdapters
- UtcDateTypeAdapter - Class in com.google.gson.typeadapters
- UtcDateTypeAdapter() - Constructor for class com.google.gson.typeadapters.UtcDateTypeAdapter
- UUID - Static variable in class com.google.gson.internal.bind.TypeAdapters
- UUID_FACTORY - Static variable in class com.google.gson.internal.bind.TypeAdapters
V
- value() - Method in annotation type com.google.gson.annotations.JsonAdapter
- value() - Method in annotation type com.google.gson.annotations.SerializedName
- value() - Method in annotation type com.google.gson.annotations.Since
-
the value indicating a version number since this member or type has been present.
- value() - Method in annotation type com.google.gson.annotations.Until
-
the value indicating a version number until this member or type should be ignored.
- value(boolean) - Method in class com.google.gson.internal.bind.JsonTreeWriter
- value(boolean) - Method in class com.google.gson.stream.JsonWriter
-
Encodes
value
. - value(double) - Method in class com.google.gson.internal.bind.JsonTreeWriter
- value(double) - Method in class com.google.gson.stream.JsonWriter
-
Encodes
value
. - value(long) - Method in class com.google.gson.internal.bind.JsonTreeWriter
- value(long) - Method in class com.google.gson.stream.JsonWriter
-
Encodes
value
. - value(Boolean) - Method in class com.google.gson.internal.bind.JsonTreeWriter
- value(Boolean) - Method in class com.google.gson.stream.JsonWriter
-
Encodes
value
. - value(Number) - Method in class com.google.gson.internal.bind.JsonTreeWriter
- value(Number) - Method in class com.google.gson.stream.JsonWriter
-
Encodes
value
. - value(String) - Method in class com.google.gson.internal.bind.JsonTreeWriter
- value(String) - Method in class com.google.gson.stream.JsonWriter
-
Encodes
value
. - valueOf(String) - Static method in enum com.google.gson.FieldNamingPolicy
-
Returns the enum constant of this type with the specified name.
- valueOf(String) - Static method in enum com.google.gson.LongSerializationPolicy
-
Returns the enum constant of this type with the specified name.
- valueOf(String) - Static method in enum com.google.gson.stream.JsonToken
-
Returns the enum constant of this type with the specified name.
- valueOf(String) - Static method in enum com.google.gson.ToNumberPolicy
-
Returns the enum constant of this type with the specified name.
- values() - Static method in enum com.google.gson.FieldNamingPolicy
-
Returns an array containing the constants of this enum type, in the order they are declared.
- values() - Static method in enum com.google.gson.LongSerializationPolicy
-
Returns an array containing the constants of this enum type, in the order they are declared.
- values() - Static method in enum com.google.gson.stream.JsonToken
-
Returns an array containing the constants of this enum type, in the order they are declared.
- values() - Static method in enum com.google.gson.ToNumberPolicy
-
Returns an array containing the constants of this enum type, in the order they are declared.
W
- withExclusionStrategy(ExclusionStrategy, boolean, boolean) - Method in class com.google.gson.internal.Excluder
- withModifiers(int...) - Method in class com.google.gson.internal.Excluder
- withVersion(double) - Method in class com.google.gson.internal.Excluder
- wrap(Class<T>) - Static method in class com.google.gson.internal.Primitives
-
Returns the corresponding wrapper type of
type
if it is a primitive type; otherwise returnstype
itself. - write(JsonElement, JsonWriter) - Static method in class com.google.gson.internal.Streams
-
Writes the JSON element to the writer, recursively.
- write(JsonWriter, Number) - Method in class com.google.gson.internal.bind.NumberTypeAdapter
- write(JsonWriter, Object) - Method in class com.google.gson.internal.bind.ArrayTypeAdapter
- write(JsonWriter, Object) - Method in class com.google.gson.internal.bind.ObjectTypeAdapter
- write(JsonWriter, Date) - Method in class com.google.gson.internal.bind.DateTypeAdapter
- write(JsonWriter, Date) - Method in class com.google.gson.internal.bind.DefaultDateTypeAdapter
- write(JsonWriter, Date) - Method in class com.google.gson.typeadapters.UtcDateTypeAdapter
- write(JsonWriter, T) - Method in class com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.Adapter
- write(JsonWriter, T) - Method in class com.google.gson.internal.bind.TreeTypeAdapter
- write(JsonWriter, T) - Method in class com.google.gson.TypeAdapter
-
Writes one JSON value (an array, object, string, number, boolean or null) for
value
. - writerForAppendable(Appendable) - Static method in class com.google.gson.internal.Streams
All Classes All Packages