开发者

flexjson.JSONDeserializer.use doesn't convert correctly

开发者 https://www.devze.com 2023-01-28 17:51 出处:网络
I\'m trying to use flexjson to convert the following json string into a java object: {\"inboundDataNotification\": {

I'm trying to use flexjson to convert the following json string into a java object:

{"inboundDataNotification": {
    "callbackData": "12345",
    "inboundData": {
        "message": "Hello World",
        "messageId": "mes1234"
    }
}}

Using the following method:

import flexjson.JSONDeserializer;

@RooJavaBean @RooToString @RooJson(f开发者_高级运维romJsonArrayMethod="", toJsonArrayMethod="", toJsonMethod="") public class InboundData {

    private String messageId;

    private String message;

    public static InboundSMSMessage fromJsonToInboundSMSMessage(String json) {
        return new JSONDeserializer<InboundSMSMessage>().use(null, InboundSMSMessage.class).deserialize(json);
    }      }

All fields are null after this method is invoked. Any ideas what to change here?

0

精彩评论

暂无评论...
验证码 换一张
取 消