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.Fields in com.google.gson with type parameters of type JsonElementModifier and TypeFieldDescriptionprivate final ArrayList<JsonElement> JsonArray.elementsprivate final LinkedTreeMap<String, JsonElement> JsonObject.membersMethods in com.google.gson that return JsonElementModifier and TypeMethodDescriptionabstract JsonElementJsonElement.deepCopy()Returns a deep copy of this element.JsonArray.get(int i) Returns the i-th element of the array.Returns the member with the specified name.private JsonElementJsonArray.getAsSingleElement()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 complete JSON string provided by the reader into a parse tree.static JsonElementJsonParser.parseString(String json) Parses the specified JSON string into a parse tree.JsonArray.remove(int index) Removes the element at the specified position in this array.Removes thepropertyfrom this object.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 TypeMethodDescriptionJsonArray.asList()Returns a mutableListview of thisJsonArray.JsonObject.asMap()Returns a mutableMapview of thisJsonObject.JsonObject.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, TypeToken<T> typeOfT) This method deserializes the JSON read from the specified parse tree into an object 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.graph
Fields in com.google.gson.graph declared as JsonElementModifier and TypeFieldDescriptionprivate final JsonElementGraphAdapterBuilder.Element.elementThe 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 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 declared as JsonElementModifier and TypeFieldDescriptionprivate JsonElementJsonTreeWriter.productthe 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_ELEMENTprivate final List<JsonElement> JsonTreeWriter.stackThe 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) JsonElementJsonTreeReader.nextJsonElement()private JsonElementJsonTreeWriter.peek()Methods in com.google.gson.internal.bind with parameters of type JsonElementModifier and TypeMethodDescription<R> RTreeTypeAdapter.GsonContextImpl.deserialize(JsonElement json, Type typeOfT) private StringMapTypeAdapterFactory.Adapter.keyToString(JsonElement keyElement) private voidJsonTreeWriter.put(JsonElement value) Constructors in com.google.gson.internal.bind with parameters of type JsonElement
JsonParser.parseReader(JsonReader)