开发者

Customising Jersey JSON marshalling for java.util.Maps

By default, marshalling a @XmlRootElement bean containing a map gives the structure:

myMap : {
    entry : {
        key : {
            ...
        },
        value : {
            ...
        }
    }
}

Is there any way to customise the JSON field names 'e开发者_运维百科ntry', 'key' and 'value'?


Use a custom @XmlJavaTypeAdapter. @Blaise Doughan has a clearly-written tutorial on using them.

See also XmlAdapter.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜