Uses of Class
com.google.gson.JsonElement
-
Packages that use JsonElement Package Description com.google.gson This package provides theGsonclass to convert Json to Java and vice-versa.com.google.gson.graph 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 -
-
Uses of JsonElement in com.google.gson
Subclasses of JsonElement in com.google.gson Modifier and Type Class Description classJsonArrayA class representing an array type in JSON.classJsonNullA class representing a JSONnullvalue.classJsonObjectA class representing an object type in JSON.classJsonPrimitiveA class representing a JSON primitive value.Fields in com.google.gson with type parameters of type JsonElement Modifier and Type Field Description private java.util.ArrayList<JsonElement>JsonArray. elementsprivate LinkedTreeMap<java.lang.String,JsonElement>JsonObject. membersMethods in com.google.gson that return JsonElement Modifier and Type Method Description abstract JsonElementJsonElement. deepCopy()Returns a deep copy of this element.JsonElementJsonArray. get(int i)Returns the i-th element of the array.JsonElementJsonObject. get(java.lang.String memberName)Returns the member with the specified name.private JsonElementJsonArray. getAsSingleElement()JsonElementJsonStreamParser. next()Returns the next availableJsonElementon the reader.JsonElementJsonParser. parse(JsonReader json)Deprecated.JsonElementJsonParser. parse(java.io.Reader json)Deprecated.JsonElementJsonParser. parse(java.lang.String json)Deprecated.static JsonElementJsonParser. parseReader(JsonReader reader)Returns the next value from the JSON stream as a parse tree.static JsonElementJsonParser. parseReader(java.io.Reader reader)Parses the complete JSON string provided by the reader into a parse tree.static JsonElementJsonParser. parseString(java.lang.String json)Parses the specified JSON string into a parse tree.JsonElementJsonArray. remove(int index)Removes the element at the specified position in this array.JsonElementJsonObject. remove(java.lang.String property)Removes thepropertyfrom this object.JsonElementJsonSerializationContext. serialize(java.lang.Object src)Invokes default serialization on the specified object.JsonElementJsonSerializationContext. serialize(java.lang.Object src, java.lang.reflect.Type typeOfSrc)Invokes default serialization on the specified object passing the specific type information.JsonElementJsonSerializer. serialize(T src, java.lang.reflect.Type typeOfSrc, JsonSerializationContext context)Gson invokes this call-back method during serialization when it encounters a field of the specified type.abstract JsonElementLongSerializationPolicy. serialize(java.lang.Long value)Serialize thisvalueusing this serialization policy.JsonElementJsonArray. set(int index, JsonElement element)Replaces the element at the specified position in this array with the specified element.JsonElementGson. toJsonTree(java.lang.Object src)This method serializes the specified object into its equivalent representation as a tree ofJsonElements.JsonElementGson. toJsonTree(java.lang.Object src, java.lang.reflect.Type typeOfSrc)This method serializes the specified object, including those of generic types, into its equivalent representation as a tree ofJsonElements.JsonElementTypeAdapter. toJsonTree(T value)Convertsvalueto a JSON tree.Methods in com.google.gson that return types with arguments of type JsonElement Modifier and Type Method Description java.util.List<JsonElement>JsonArray. asList()Returns a mutableListview of thisJsonArray.java.util.Map<java.lang.String,JsonElement>JsonObject. asMap()Returns a mutableMapview of thisJsonObject.java.util.Set<java.util.Map.Entry<java.lang.String,JsonElement>>JsonObject. entrySet()Returns a set of members of this object.java.util.Iterator<JsonElement>JsonArray. iterator()Returns an iterator to navigate the elements of the array.Methods in com.google.gson with parameters of type JsonElement Modifier and Type Method Description voidJsonArray. add(JsonElement element)Adds the specified element to self.voidJsonObject. add(java.lang.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, java.lang.reflect.Type typeOfT)Invokes default deserialization on the specified object.TJsonDeserializer. deserialize(JsonElement json, java.lang.reflect.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, java.lang.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, java.lang.reflect.Type typeOfT)This method deserializes the JSON read from the specified parse tree into an object of the specified type.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.JsonElementJsonArray. set(int index, JsonElement element)Replaces the element at the specified position in this array with the specified element.java.lang.StringGson. 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, java.lang.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 JsonElement Modifier and Type Field Description private JsonElementGraphAdapterBuilder.Element. elementThe element to deserialize.Constructors in com.google.gson.graph with parameters of type JsonElement Constructor Description Element(T value, java.lang.String id, TypeAdapter<T> typeAdapter, JsonElement element) -
Uses of JsonElement in com.google.gson.internal
Methods in com.google.gson.internal that return JsonElement Modifier and Type Method Description static 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 JsonElement Modifier and Type Method Description static 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 JsonElement Modifier and Type Field Description private JsonElementJsonTreeWriter. productthe JSON element constructed by this writer.Fields in com.google.gson.internal.bind with type parameters of type JsonElement Modifier and Type Field Description static TypeAdapter<JsonElement>TypeAdapters. JSON_ELEMENTprivate java.util.List<JsonElement>JsonTreeWriter. stackThe JsonElements and JsonArrays under modification, outermost to innermost.Methods in com.google.gson.internal.bind that return JsonElement Modifier and Type Method Description JsonElementJsonTreeWriter. get()Returns the top level object produced by this writer.(package private) JsonElementJsonTreeReader. nextJsonElement()private JsonElementJsonTreeWriter. peek()JsonElementJsonElementTypeAdapter. read(JsonReader in)private JsonElementJsonElementTypeAdapter. readTerminal(JsonReader in, JsonToken peeked)Reads aJsonElementwhich cannot have any nested elementsJsonElementTreeTypeAdapter.GsonContextImpl. serialize(java.lang.Object src)JsonElementTreeTypeAdapter.GsonContextImpl. serialize(java.lang.Object src, java.lang.reflect.Type typeOfSrc)private JsonElementJsonElementTypeAdapter. tryBeginNesting(JsonReader in, JsonToken peeked)Tries to begin reading a JSON array or JSON object, returningnullif the next element is neither of those.Methods in com.google.gson.internal.bind with parameters of type JsonElement Modifier and Type Method Description <R> RTreeTypeAdapter.GsonContextImpl. deserialize(JsonElement json, java.lang.reflect.Type typeOfT)private java.lang.StringMapTypeAdapterFactory.Adapter. keyToString(JsonElement keyElement)private voidJsonTreeWriter. put(JsonElement value)voidJsonElementTypeAdapter. write(JsonWriter out, JsonElement value)Constructors in com.google.gson.internal.bind with parameters of type JsonElement Constructor Description JsonTreeReader(JsonElement element)
-