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 classA class representing an array type in Json.final classA class representing a Jsonnullvalue.final classA class representing an object type in Json.final classA class representing a Json primitive value.Classes in com.google.gson that implement interfaces with type arguments of type JsonElementModifier and TypeClassDescriptionfinal classA class representing an array type in Json.final classA streaming parser that allows reading of multipleJsonElements from the specified reader asynchronously.Methods in com.google.gson that return JsonElementModifier and TypeMethodDescriptionabstract JsonElementJsonElement.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 availableJsonElementon the reader.JsonParser.parse(JsonReader json) Deprecated.Deprecated.Deprecated.static JsonElementJsonParser.parseReader(JsonReader reader) Returns the next value from the JSON stream as a parse tree.static JsonElementJsonParser.parseReader(Reader reader) Parses the specified JSON string into a parse treestatic JsonElementJsonParser.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 thepropertyfrom 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 JsonElementSerialize thisvalueusing 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 ofJsonElements.Gson.toJsonTree(Object src, Type typeOfSrc) This method serializes the specified object, including those of generic types, into its equivalent representation as a tree ofJsonElements.final JsonElementTypeAdapter.toJsonTree(T value) Convertsvalueto 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 TypeMethodDescriptionvoidJsonArray.add(JsonElement element) Adds the specified element to self.voidJsonObject.add(String property, JsonElement value) Adds a member, which is a name-value pair, to self.booleanJsonArray.contains(JsonElement element) Returns true if this array contains the specified element.<T> TJsonDeserializationContext.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> TGson.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> TGson.fromJson(JsonElement json, Type typeOfT) This method deserializes the Json read from the specified parse tree into an object of the specified type.final TTypeAdapter.fromJsonTree(JsonElement jsonTree) ConvertsjsonTreeto a Java object.booleanJsonArray.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 ofJsonElements into its equivalent JSON representation.voidGson.toJson(JsonElement jsonElement, JsonWriter writer) Writes the JSON forjsonElementtowriter.voidGson.toJson(JsonElement jsonElement, Appendable writer) Writes out the equivalent JSON for a tree ofJsonElements. -
Uses of JsonElement in com.google.gson.internal
Methods in com.google.gson.internal that return JsonElementModifier and TypeMethodDescriptionstatic JsonElementStreams.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 voidStreams.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 with type parameters of type JsonElementMethods in com.google.gson.internal.bind that return JsonElementModifier and TypeMethodDescriptionJsonTreeWriter.get()Returns the top level object produced by this writer.Constructors in com.google.gson.internal.bind with parameters of type JsonElement
JsonParser.parseReader(JsonReader)