Loading ...
Sorry, an error occurred while loading the content.

1299Re: [json] JSON to java

Expand Messages
  • Tatu Saloranta
    Jul 15, 2009
    • 0 Attachment
      On Wed, Jul 15, 2009 at 1:17 PM, dey_nibedita<dey_nibedita@...> wrote:
      > What is the best way to convert JSON value to java object so that it can be sent to server? It needs to be free / open source.

      Just to make sure: if you already have JSON content, why would you
      need to convert it to Java object?
      Couldn't you just send it as is?

      But assuming this makes sense, in addition to google-gson which was
      mentioned and can do this, some (not all) of libs listed at json.org
      can do data binding:

      * Jackson (http://wiki.fasterxml.com/JacksonInFiveMinutes)
      * Json-tools (http://developer.berlios.de/projects/jsontools/)

      most other alternatives only provide either tree-based access, or
      mapping to 'simple' java types (List, Maps, Booleans, Numbers,
      Strings). Which are of course java objects, strictly speaking, but I
      assume you would want custom beans etc, sort "real" objects.

      -+ Tatu +-
    • Show all 6 messages in this topic