MPJsonParser

open class MPJsonParser

[INTERNAL USAGE] Internal convenience class, for parsing to and from JSON and POJOs. The underlying parsing engine is Gson.

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
open fun <T> parse(element: JsonElement, clazz: Class<T>): T
open fun <T> parse(element: JsonElement, type: Type): T
open fun <T> parse(stream: InputStream, clazz: Class<T>): T
open fun <T> parse(stream: InputStream, type: Type): T
open fun <T> parse(json: String, clazz: Class<T>): T
open fun <T> parse(json: String, type: Type): T
Parse JSON string to pojo
Link copied to clipboard
open fun registerTypeAdapter(type: Type, typeAdapter: Any)
Add type converter to parsing engine
Link copied to clipboard
open fun <T> toJson(object: T): String
open fun <T> toJson(object: T, clazz: Class<T>): String
open fun <T> toJson(object: T, type: Type): String
Parse pojo to JSON string