Converting JSON data to Java object

后端 未结 12 1108
春和景丽
春和景丽 2020-11-21 05:11

I want to be able to access properties from a JSON string within my Java action method. The string is available by simply saying myJsonString = object.getJson()

12条回答
  •  悲哀的现实
    2020-11-21 05:40

    Oddly, the only decent JSON processor mentioned so far has been GSON.

    Here are more good choices:

    • Jackson (Github) -- powerful data binding (JSON to/from POJOs), streaming (ultra fast), tree model (convenient for untyped access)
    • Flex-JSON -- highly configurable serialization

    EDIT (Aug/2013):

    One more to consider:

    • Genson -- functionality similar to Jackson, aimed to be easier to configure by developer

提交回复
热议问题