Thursday, March 5, 2015

Re: Which Json/JSON package I have to use?



On Thursday, March 5, 2015 at 10:32:55 AM UTC+1, Alex Ph wrote:
Hi all,
I want to upgrade from 2.6.1 to 2.7.0 and I use autobeans to handle JSON data. Due to json-issues (like https://code.google.com/p/google-web-toolkit/issues/detail?id=8762) you moved/removed the org.json package and I have to reorg my imports.

I have three options to replace my old org.json.JSONObject import and I wonder which import I have to choose:

If you use AutoBeans, why do you need org.json?
Anyway, if you need org.json, add it as a dependency (download the JAR, or add the dependency to your pom.xml or build.gradle or ivy.xml or whatever you're using) and use it (and comply with its license).

1) com.google.gwt.thirdparty.json.JSONObject (used by Autobean)

Anything in c.g.g.thirdparty can change without notice between GWT versions, so it could very well disappear in the next version of GWT.
 
2) com.google.gwt.json.client.JSONObject

This is only usable in client-side code; won't work where you used to use org.json.
 
3) com.google.gwt.dev.json.JsonObject

Isn't in gwt-servlet.jar AFAIK, so won't be available at runtime.
 
Any Hints here?

There's also elemental.json but it's still experimental.

No, really, if you're happy with org.json, then just continue using it; all you have to do is add it to your classpath.

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment