gson

    1热度

    3回答

    我有这样的JSON: { "username": [ "A user with that username already exists." ], "ruc": [ "user with this ruc already exists." ], "code": [ "user with this code alr

    0热度

    1回答

    我使用retrofit 2.0从后端获取用户信息,并使用Gson解析json数据。 像"/some/image/folders/"一些路径信息,我接收到的数据被改变为"\/some\/image\/folders\/",反斜线在每个斜线的前加入。我们只是搁置这一变化。 我收到路径信息后,okhttp调试日志显示的字符串值是"\/some\/image\/folders\/",但是当我登录的resp

    -1热度

    1回答

    我正在使用Java,并且有两个列表,一个具有字段名称,另一个具有值。我正在使用列表值生成JSON,它工作正常,如下所示。 String json = new GsonBuilder().setPrettyPrinting().disableHtmlEscaping(). create().toJson(fieldValues); fileOut.println(

    0热度

    1回答

    的JSON: [{"DataContainer": { "ShoppingDetails": [ [ { "Value": "3", "Name": "Price" }, { "Value": "XAV-13-9LO", "Name": "Item Code" }

    -1热度

    3回答

    我想帮助获取android中的对象返回键和值。 这是json对象,我想检查结果是否成功,然后继续执行其他操作。 { "product_name": "iPhone 8", "result": " Success", "error": null, "description": "iphone 8, the best phone", "agent":

    1热度

    1回答

    有这个类: class Project { val nameProperty = SimpleStringProperty("foobar") val name by nameProperty } 我用Fx-GSON库连载JavaFX的属性。 当我把它序列化到JSON我得到这个: { "nameProperty": "foobar", "name$de

    0热度

    2回答

    在我的Android应用程序(用Kotlin编写)中,我需要将一些JSON变成一个字符串给MainObject哈希映射。这是JSON的样子: { "a": { "name": "A", "some_int": "2", "some_string": "string", "some_bool": false, "some_stri

    -1热度

    1回答

    在我的应用程序中,我从Web服务获取数据并在回收站视图中显示这些数据。之后,我打算将这些数据添加到本地sqlite数据库,并显示这些数据时,用户打开应用程序没有互联网连接。 下面是我使用的GSON public class Repo implements Parcelable { @SerializedName("id") @Expose private Integ

    0热度

    3回答

    正确的价值观 您好我试图解析JSON,如: {"error":{"code":20,"message":"Transaction not found."}} 所使用的代码是: GulfBoxError errordetails= new Gson().fromJson(json, GulfBoxError.class); System.out.println("RESULT :

    0热度

    3回答

    这是我的问题。我从互联网上得到一个随机的json文件,如this one或this one。 我想解析它与JSON在android studio(使用例如,gson)。但是我无法在gson中找到这样的选项,让我从JSON文件中选择一个不知道JSON结构的标记(并创建一个类和那些东西)。当我试图做到这一点在VisualBasic.NET它是很容易,使用此代码和NewtonSoft.Json库: Di