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. -
-
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.Methods 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 ith element of the array.JsonElementJsonObject. get(String memberName)Returns the member with the specified name.JsonElementJsonStreamParser. next()Returns the next availableJsonElementon the reader.JsonElementJsonParser. parse(JsonReader json)Deprecated.JsonElementJsonParser. parse(Reader json)Deprecated.JsonElementJsonParser. parse(String json)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 treeJsonElementJsonArray. remove(int index)Removes the element at the specified position in this array.JsonElementJsonObject. remove(String property)Removes thepropertyfrom thisJsonObject.JsonElementJsonSerializationContext. serialize(Object src)Invokes default serialization on the specified object.JsonElementJsonSerializationContext. serialize(Object src, Type typeOfSrc)Invokes default serialization on the specified object passing the specific type information.JsonElementJsonSerializer. 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 JsonElementLongSerializationPolicy. serialize(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(Object src)This method serializes the specified object into its equivalent representation as a tree ofJsonElements.JsonElementGson. toJsonTree(Object src, 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 Set<Map.Entry<String,JsonElement>>JsonObject. entrySet()Returns a set of members of this object.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(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.TJsonDeserializer. 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.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.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, Appendable writer)Writes out the equivalent JSON for a tree ofJsonElements.
-