0

我的问题是如何在 Inner Json 对象类中实现 Logansquare 自定义 TypeConverter 类。

这是我的模型课:

class CommunicationParser{

    @JsonField
    public String MSG;
    @JsonField
    public int DATA_ID;
    @JsonField
    public ArrayList<Records> RECORDS;

    @JsonObject
    public static class Records {
        @JsonField
        public String REC1;
        @JsonField
        public String REC2;
        @JsonField
        public int REC_VALUE;

      @JsonField   // Error occur when apply annotation
        public communication COMMUNICATIONACTION;  //MAKE ERROR IN THIS LINE

    }

    @JsonObject
    public static class communication {
        @JsonField
        public PrimaryAction PRIMARYACTION;
        @JsonField
        public ArrayList<SecondaryAction> SECONDARYACTION;
    }

    @JsonObject
    public static class PrimaryAction {
        @JsonField
        public int ID;
        @JsonField
        public String TITLE;
    }

    @JsonObject
    public static class SecondaryAction {
        @JsonField
        public int ID;
        @JsonField
        public String TITLE;
    }
}

如何在 Inner Json 对象类中实现 Logansquare 自定义 TypeConverter 类?请给我一个解决方案..

提前致谢

4

0 回答 0