Uses of Class
com.google.gson.JsonElement
Packages that use JsonElement
Package
Description
This package provides the
Gson
class to convert Json to Java and
vice-versa.Do NOT use any class in this package as they are meant for internal use in Gson.
-
Uses of JsonElement in com.google.gson
Subclasses of JsonElement in com.google.gsonModifier and TypeClassDescriptionfinal class
A class representing an array type in Json.final class
A class representing a Jsonnull
value.final class
A class representing an object type in Json.final class
A class representing a Json primitive value.Fields in com.google.gson with type parameters of type JsonElementModifier and TypeFieldDescriptionprivate final List<JsonElement>
JsonArray.elements
private final LinkedTreeMap<String,
JsonElement> JsonObject.members
Methods in com.google.gson that return JsonElementModifier and TypeMethodDescriptionabstract JsonElement
JsonElement.deepCopy()
Returns a deep copy of this element.JsonArray.get
(int i) Returns the ith element of the array.Returns the member with the specified name.JsonStreamParser.next()
Returns the next availableJsonElement
on the reader.JsonParser.parse
(JsonReader json) Deprecated.Deprecated.Deprecated.static JsonElement
JsonParser.parseReader
(JsonReader reader) Returns the next value from the JSON stream as a parse tree.static JsonElement
JsonParser.parseReader
(Reader reader) Parses the specified JSON string into a parse treestatic JsonElement
JsonParser.parseString
(String json) Parses the specified JSON string into a parse treeJsonArray.remove
(int index) Removes the element at the specified position in this array.Removes theproperty
from thisJsonObject
.Invokes default serialization on the specified object.Invokes default serialization on the specified object passing the specific type information.JsonSerializer.serialize
(T src, Type typeOfSrc, JsonSerializationContext context) Gson invokes this call-back method during serialization when it encounters a field of the specified type.abstract JsonElement
Serialize thisvalue
using this serialization policy.JsonArray.set
(int index, JsonElement element) Replaces the element at the specified position in this array with the specified element.Gson.toJsonTree
(Object src) This method serializes the specified object into its equivalent representation as a tree ofJsonElement
s.Gson.toJsonTree
(Object src, Type typeOfSrc) This method serializes the specified object, including those of generic types, into its equivalent representation as a tree ofJsonElement
s.final JsonElement
TypeAdapter.toJsonTree
(T value) Convertsvalue
to a JSON tree.Methods in com.google.gson that return types with arguments of type JsonElementModifier and TypeMethodDescriptionJsonObject.entrySet()
Returns a set of members of this object.JsonArray.iterator()
Returns an iterator to navigate the elements of the array.Methods in com.google.gson with parameters of type JsonElementModifier and TypeMethodDescriptionvoid
JsonArray.add
(JsonElement element) Adds the specified element to self.void
JsonObject.add
(String property, JsonElement value) Adds a member, which is a name-value pair, to self.boolean
JsonArray.contains
(JsonElement element) Returns true if this array contains the specified element.<T> T
JsonDeserializationContext.deserialize
(JsonElement json, Type typeOfT) Invokes default deserialization on the specified object.JsonDeserializer.deserialize
(JsonElement json, Type typeOfT, JsonDeserializationContext context) Gson invokes this call-back method during deserialization when it encounters a field of the specified type.<T> T
Gson.fromJson
(JsonElement json, Class<T> classOfT) This method deserializes the Json read from the specified parse tree into an object of the specified type.<T> T
Gson.fromJson
(JsonElement json, Type typeOfT) This method deserializes the Json read from the specified parse tree into an object of the specified type.final T
TypeAdapter.fromJsonTree
(JsonElement jsonTree) ConvertsjsonTree
to a Java object.boolean
JsonArray.remove
(JsonElement element) Removes the first occurrence of the specified element from this array, if it is present.JsonArray.set
(int index, JsonElement element) Replaces the element at the specified position in this array with the specified element.Gson.toJson
(JsonElement jsonElement) Converts a tree ofJsonElement
s into its equivalent JSON representation.void
Gson.toJson
(JsonElement jsonElement, JsonWriter writer) Writes the JSON forjsonElement
towriter
.void
Gson.toJson
(JsonElement jsonElement, Appendable writer) Writes out the equivalent JSON for a tree ofJsonElement
s. -
Uses of JsonElement in com.google.gson.graph
Fields in com.google.gson.graph declared as JsonElementModifier and TypeFieldDescriptionprivate final JsonElement
GraphAdapterBuilder.Element.element
The element to deserialize.Constructors in com.google.gson.graph with parameters of type JsonElementModifierConstructorDescription(package private)
Element
(T value, String id, TypeAdapter<T> typeAdapter, JsonElement element) -
Uses of JsonElement in com.google.gson.internal
Methods in com.google.gson.internal that return JsonElementModifier and TypeMethodDescriptionstatic JsonElement
Streams.parse
(JsonReader reader) Takes a reader in any state and returns the next value as a JsonElement.Methods in com.google.gson.internal with parameters of type JsonElementModifier and TypeMethodDescriptionstatic void
Streams.write
(JsonElement element, JsonWriter writer) Writes the JSON element to the writer, recursively. -
Uses of JsonElement in com.google.gson.internal.bind
Fields in com.google.gson.internal.bind declared as JsonElementModifier and TypeFieldDescriptionprivate JsonElement
JsonTreeWriter.product
the JSON element constructed by this writer.Fields in com.google.gson.internal.bind with type parameters of type JsonElementModifier and TypeFieldDescriptionstatic final TypeAdapter<JsonElement>
TypeAdapters.JSON_ELEMENT
private final List<JsonElement>
JsonTreeWriter.stack
The JsonElements and JsonArrays under modification, outermost to innermost.Methods in com.google.gson.internal.bind that return JsonElementModifier and TypeMethodDescriptionJsonTreeWriter.get()
Returns the top level object produced by this writer.(package private) JsonElement
JsonTreeReader.nextJsonElement()
private JsonElement
JsonTreeWriter.peek()
Methods in com.google.gson.internal.bind with parameters of type JsonElementModifier and TypeMethodDescription<R> R
TreeTypeAdapter.GsonContextImpl.deserialize
(JsonElement json, Type typeOfT) private String
MapTypeAdapterFactory.Adapter.keyToString
(JsonElement keyElement) private void
JsonTreeWriter.put
(JsonElement value) Constructors in com.google.gson.internal.bind with parameters of type JsonElement
JsonParser.parseReader(JsonReader)