Mined Opinions For API: genson

This tab contains all the opinions collected from Stack Overflow about the API. The other tabs present summaries of the opinions using different algorithms.
  • @mgibson great you like it :) yeah sure if you use maven use the dependency from here URL_http://code.google.com/p/genson/wiki/GettingStarted Download, if you just want to dl the jar you can find it here URL_http://mvnrepository.com/artifact/com.owlike/genson/0.94 (you have a download link there).. details
  • Thanks, it works.. details
  • @uegen yes, it is a powerful idea, glad to see genson also supports it!.. details
  • FWIW, almost all Java JSON libraries support this conversion mode, including GSON, Jackson and Genson.. details
  • String routineListInJSON; routineListInJSON genson.serialize(tempSaveObject); editor.putString(ROUTINE_LIST, routineListInJSON).commit(); I will have a play around with it and check out those resources - any ideas yourself though would also be well received!. details
  • The reason I asked was exactly to give reasons above and beyond established choices -- maturity is valuable too, and AFAIK Genson is a very new lib.. details
  • Anyway, thanks for listing expected benefits, this is better than just suggesting using another lib without justification.. details
  • This is a good answer, but if you don't want to use other libraries, you could also add a private member to GeneralTemplate which contains the class name as string.. details
  • @mgibson cool waiting towards your feedback :) if you have questions on genson you can read the wiki and use its google group to ask for help.. details
  • Even if it's not clear from my comments, I think new stuff is good, and that Genson actual looks more solid than most new libs.. details
  • That's a great tip, thanks!. details
  • @mgibson great you like it :) yeah sure if you use maven use the dependency from here URL_http://code.google.com/p/genson/wiki/GettingStarted Download, if you just want to dl the jar you can find it here URL_http://mvnrepository.com/artifact/com.owlike/genson/0.94 (you have a download link there).. details
  • Please show how you reload.. details
  • Ah yes, pretty key that!.. details
  • Hmmm, Genson looks pretty handy.. details
  • Took 2 mins to get it working and it does what I need!.. details
  • Ok fair enough!. details
  • Thanks, it works.. details
  • Thanks.. details
  • Thanks!. details
  • This is the shizzle!. details
  • Anyway, thanks for listing expected benefits, this is better than just suggesting using another lib without justification.. details
  • I'll definitely look into that!.. details
  • Ok, thanks for confirm that, I will report the issue.. details
  • My understanding of data-binding was that it automatically converted the respective values from the JSON and stored it in the Java object.. details
  • Try adding URL_http://code.google.com/p/genson/ [Genson] to your classpath, it will automatically enable json support.. details
  • Genson appears to support JSONAPI format.. details
  • Or if you want genson to use only fields instead of public getter/setter and fields, configure it like that: CODESNIPPET_JAVA1 .. details
  • I fixed the questions, thanks.. details
  • I know that at least following support this mode of operation: Jackson Gson Genson For Jackson, basic Streaming API usage is talked about URL_http://www.cowtowncoder.com/blog/archives/2009/01/entry_132.html [here] (for example); but one thing that does not show is how to bind objects once you are positioned at the right place.So assuming JSON like: CODESNIPPET_JAVA1 .. details
  • Thanks for the answer.. details
  • I'll take a look though thanks.. details
  • Thank you sir!. details
  • Thank you so much, this helped a lot!. details
  • Thank you so much, this helped a lot!. details
  • Genson goal is indeed to answer to problems not handled by existing libraries (the initial one was extension) now it is also important that people try it out and judge by them self if it is good or not.. details
  • Thats why Genson has been created and this is one of main advantages of Genson over Jackson.. details
  • I hope however that you will also try Genson.... details
  • Thanks for the help!.. details
  • Truth is, I had begun writing some code in Jackson already, so if I can come up with something equivalent to what you have in genson, I will probably stick with Jackson.. details
  • Like Genson GenericType, jackson provides a class called TypeReference that allows you to work with parameterized types, new TypeReference>(){}.getType().. details
  • Compared to Jackson it is more a matter of vision, jackson tries to handle a lot of cases but by making extension really hard, Genson takes another approach=> provide nice features but stay open to extension.. details
  • However main advantages of Genson are : faster then Gson, more usefull features and is more flexible (you can add yourself new features in a more easy way).. details
  • However main advantages of Genson are : faster then Gson, more usefull features and is more flexible (you can add yourself new features in a more easy way).. details
  • It is a bit like you were asking why try an android when iphone exists and is widely used.... details
  • Compared to Jackson it is more a matter of vision, jackson tries to handle a lot of cases but by making extension really hard, Genson takes another approach=> provide nice features but stay open to extension.. details
  • It is a bit like you were asking why try an android when iphone exists and is widely used.... details
  • Any particular reason to try Genson instead of proven and widely used packages like Jackson or GSON?. details
  • This is very close to what I'm trying to accomplish.. details
  • Great, I hope you will like it, in fact I am gensons author ).. details
  • Great, I hope you will like it, in fact I am gensons author ).. details
  • Thanks, I'll definitely take a look!. details
  • Genson applies the philosophy that "We can not think of every use case, so give to users the ability to do it by them self in a easy way"... details
  • Here's their first goal, and it looks promising: Be as much extensible as possible by allowing users to add new functionnalities in a clean and easy way.. details
  • Take a look at URL_http://code.google.com/p/genson/ [Genson] it provides full databinding support, with polymorphic and untyped objects and has many other features.. details
  • But I have to accept above answer because he replied first but appreciate your effort too thanks!. details
  • But I have to accept above answer because he replied first but appreciate your effort too thanks!. details
  • Very very good, I'm good impressed by your library (since seems that you are the developer)!!. details
  • Very very good, I'm good impressed by your library (since seems that you are the developer)!!. details
  • You also have URL_http://code.google.com/p/genson/ [Genson] lib that has nice features, perfs, provides alternatives to annotations and is easy to use.. details
  • You could also try out URL_http://code.google.com/p/genson/ [Genson] library, handling polymorphic types is supported out of the box.. details
  • URL_https://code.google.com/p/genson/downloads/detail?name=genson-0.94.jar&can 2&q [ URL_https://code.google.com/p/genson/downloads/detail?name=genson-0.94.jar & can=2&q=] Made things so much easier, no need for custom serializers/deserializers.. details
  • Thanks in advance.. details
  • This will work on Jackson as well as many other Java JSON libs (Gson, Genson at least), and will also be faster method to use.. details
  • This will work on Jackson as well as many other Java JSON libs (Gson, Genson at least), and will also be faster method to use.. details
  • But I don't know if your content is like that.. details
  • Try for example URL_http://code.google.com/p/genson/ [Genson] , it will work out of the box.The values in the json stream would be "Close", "Indeterminate", etc and when deserializing it will produce the correct enum.. details
  • Another nice thing with Genson is that it gives you the ability to register aliases for your classes, so you do not have to make all the package info available in your stream.. details
  • However all this stuff looks quite complex, if you are free to try another library you might want to have a look at URL_http://code.google.com/p/genson/ [Genson] .To enable polymorphic types support you have to configure your Genson instance.. details
  • You might also want to try URL_http://code.google.com/p/genson/ [Genson-lib] .I just checked your example with it, and everything seems to work fine.To enable polymorphic types support in Genson you need to configure your genson instance: CODESNIPPET_JAVA1 .. details
  • You don't need any configuration to enable json support with Genson, just drop the jar in your classpath.. details
  • Also for doing json<>java databiding you can check Genson library URL_http://code.google.com/p/genson/ [ URL_http://code.google.com/p/genson/ ] , it integrates well with Jersey.. details
  • The serialized json will look like : {"content": {"@class":"package.path.Message", ...the object values...}} You can even define aliases for the serialized classes CODESNIPPET_JAVA2 .. details
  • And as a bonus with jersey you only need to have genson in your classpath and voila!. details
  • If you are not tied to jackson you could also try Genson URL_http://code.google.com/p/genson/ [ URL_http://code.google.com/p/genson/ ] .In your case there are two main advantages: you will not loose in performance, it should be easier to implement.. details
  • You could use a library providing databinding support.You can try Genson URL_http://code.google.com/p/genson/ [ URL_http://code.google.com/p/genson/ ] , it is fast, easy to use and has a couple of nice features.. details
  • You can have a look at Genson library URL_http://code.google.com/p/genson/ [ URL_http://code.google.com/p/genson/ ] , on the wiki page you will find some examples on how to use it.Since its first release it provides the streaming model and seems to be the fastest after Jackson, see the URL_http://code.google.com/p/genson/wiki/Metrics2 [benchmarks] .. details
  • You can have a look at Genson library URL_http://code.google.com/p/genson/ [ URL_http://code.google.com/p/genson/ ] , on the wiki page you will find some examples on how to use it.Since its first release it provides the streaming model and seems to be the fastest after Jackson, see the URL_http://code.google.com/p/genson/wiki/Metrics2 [benchmarks] .. details
  • It will not print exactly the structure you are expecting as it requires more code to count efficiently with your structure : CODESNIPPET_JAVA1 .. details
  • EDIT**Here is another version shorter and nicer but not contained in the released version 0.91 (I will probably release the new version today as I am the author :))To make it work you will have to annotate your getters (and setters if you also do serialization) with @JsonProperty(the_name_from_json).. details
  • If you want to combine your two json objects into a single java object here is a solution with Genson library URL_http://code.google.com/p/genson/ [ URL_http://code.google.com/p/genson/ ] .The following code could be shortened and use Gensons standard converters but It would be less clear as an example.. details
  • Hope this helps!. details
  • If you want to combine your two json objects into a single java object here is a solution with Genson library URL_http://code.google.com/p/genson/ [ URL_http://code.google.com/p/genson/ ] .The following code could be shortened and use Gensons standard converters but It would be less clear as an example.. details
  • It has a couple of nice features that do not exisit in other librairies.Such as using constructor with arguments without any annotation or applying what is called BeanView on your objects at runtime (acts a as view of your model), can deserialize to concrete types, and more... Take a look at the wiki URL_http://code.google.com/p/genson/wiki/GettingStarted [ URL_http://code.google.com/p/genson/wiki/GettingStarted ] .. details
  • You can try Genson library URL_http://code.google.com/p/genson/ [ URL_http://code.google.com/p/genson/ ] .I just tested your code with it and it works fine the output is {"name":"foo"} CODESNIPPET_JAVA1 .. details
  • However xml support may be added in a future version.. details
  • Actually Genson is faster and has more features than Gson and has performances close to jackson (but its a lot more lightweight) see URL_http://code.google.com/p/genson/wiki/Metrics [ URL_http://code.google.com/p/genson/wiki/Metrics ] .. details
  • At the begining its main advantage was good support of Java generics but Jackson and Genson provide it too.. details
  • If you don't want to use Genson, I really recommend you Jackson over Gson.. details
  • Its performances were not good (especially compared to Jackson or Genson).With the latest versions it has improved as they also provide a streaming api, but its still not fast enough.. details
  • Genson is well suited for all kind of use cases, ranging from simple conversion, to full customization of all the process.. details
  • Actually Genson is faster and has more features than Gson and has performances close to jackson (but its a lot more lightweight) see URL_http://code.google.com/p/genson/wiki/Metrics [ URL_http://code.google.com/p/genson/wiki/Metrics ] .. details
  • Its performances were not good (especially compared to Jackson or Genson).With the latest versions it has improved as they also provide a streaming api, but its still not fast enough.. details
  • It uses streaming api instead of a dom model that brings better scalability and is nice in web applications where you can handle the conversion as the input arrives.. details
  • Here are more good choices: URL_http://wiki.fasterxml.com/JacksonHome [Jackson] -- powerful data binding (JSON to/from POJOs), streaming (ultra fast), tree model (convenient for untyped access) URL_http://flexjson.sourceforge.net/ [Flex-JSON] -- highly configurable serialization EDIT (Aug/2013): One more to consider: URL_http://code.google.com/p/genson/ [Genson] -- functionality similar to Jackson, aimed to be easier to configure by developer .. details
  • @mgibson by the way you should not get source code for libs and package it your self, as the code in the trunk is not matching the released version.. details
  • you can also have a look at genson URL_http://code.google.com/p/genson /, it is easy to use, provides streaming api/databinding, can deserialize even if there is no default ctr and much more.. details
  • This is an example unit test: URL_https://code.google.com/p/genson/source/browse/src/test/java/com/owlike/ge nson/JsonSerDeserSymetricTest.java?r=2b80106be551560dd27cef4197de0d0500e93439 [JsonSerDeserSymetricTest.java] demonstrating deserialising a feed into classes.. details
  • The classes include: URL_https://code.google.com/p/genson/source/browse/src/test/java/com/owlike/ge nson/bean/Feed.java?r=2b80106be551560dd27cef4197de0d0500e93439 [Feed.java] - which has an id field URL_https://code.google.com/p/genson/source/browse/src/t est/java/com/owlike/genson/bean/Link.java?r=2b80106be551560dd27cef4197de0d0500 e93439 [Link.java] - which has a href field Genson will integrate with URL_https://code.google.com/p/genson/wiki/SpringIntegration [Spring-MVC] and URL_https://code.google.com/p/genson/wiki/JerseyIntegration [Jersey-for-JAX- RS] .. details
  • Here is an example on how to implement a bodywriter/reader URL_http://code.google.com/p /genson/source/browse/src/main/java/com/owlike/genson/ext/jersey/GensonJsonCon verter.java.. details
  • will definitely give it a shot.. details
  • But that maturity comes is nonsense.. details
  • Indeed Genson is a new lib and Genson has most of Jackson features and others, for a new library I think it is quite serious!. details
  • This example is mainly intended to show how to use the streaming api of genson and give a hint on how to solve your problem.. details
  • Also if you don't want impl details to leak in the json representation, you can define aliases (builder.addAlias("someAlias", SomeClass.class) for your types, they will be used instead of full package+classname.. details
  • Putting @JsonProperty("name") on the ctr parameter and using gensons previous configuration solved the problem.. details
  • Putting @JsonProperty("name") on the ctr parameter and using gensons previous configuration solved the problem.. details
  • Normally I would use GSON or Genson to map this back to a Java POJO, but this is the only area of the code where I have to do this and I want to be lazy here ;-).. details
  • Have a look at URL_http://code.google.com/p/genson/wiki/GettingStarted [Genson] library some of its key features are adressing your exact problem: polymorphism, not requiring annotations and most important immutable pojos.. details
  • Finally, if your input consists of a sequence of items, there are even better ways to slice it up (which can be done regardless of whether individual items would be CODETERM3 s or POJOs!).. details
  • It doesnt require you to write additional code, it should work like what you have now but without any weird result.. details
  • You can try to replace jackson by URL_http://code.google.com/p/genson/ [Genson] on the server side, it should solve your problem.. details
  • Have a look at Genson library URL_http://code.google.com/p/genson/ [ URL_http://code.google.com/p/genson/ ] .If your classes are inner classes make them static.The following code should solve your problem.. details
  • Here is how you can solve your problem with genson (for this example it is quite similar to jackson): CODESNIPPET_JAVA2 .. details
  • Otherwise you could use a Genson instance to parse your file directly to java objects, but in your case I don't think it is the right solution as it will require you to store all the objects in memory!. details
  • In addition it weights as much as gson (200K).An example with Genson for your problem: CODESNIPPET_JAVA1 .. details
  • Note that Genson does not need any getter/setter if you want it can only use the fields (by default it uses getter/setter if avaible otherwise the field).. details
  • You could file a bug -- if Genson can handle it, Jackson should too.. details
  • You could file a bug -- if Genson can handle it, Jackson should too.. details
  • Disclaimer: I'm the author of the library but I try to be objective (especially in the benchmarks).. details
  • You can configure a lot of things (use fields and/or methods, use constructor with arguments and without any annotation, filter properties by visibility and a lot more).. details
  • Note also that Gson comes with less features out of the box than Genson or Jackson.I also tried to implement the features I needed in Gson but I found that the Beans databinding part was not extensible (near everything in a single class with no extension points), so I would have to rewrite it.. details
Summaries the opinions about genson using topic modeling.
  • 0. ability gson jackson provide close lot polymorphic stream thing alias: 8
    • Anyway, thanks for listing expected benefits, this is better than just suggesting using another lib without justification.. details
    • This is very close to what I'm trying to accomplish.. details
    • Genson applies the philosophy that "We can not think of every use case, so give to users the ability to do it by them self in a easy way"... details
    • Take a look at Genson it provides full databinding support, with polymorphic and untyped objects and has many other features.. details
    • You also have Genson lib that has nice features, perfs, provides alternatives to annotations and is easy to use.. details
    • Another nice thing with Genson is that it gives you the ability to register aliases for your classes, so you do not have to make all the package info available in your stream.. details
    • However xml support may be added in a future version.. details
    • Actually Genson is faster and has more features than Gson and has performances close to jackson (but its a lot more lightweight) see .. details
  • 1. jackson provide release extension typereference stream compare enable lot case: 8
    • Like Genson GenericType, jackson provides a class called TypeReference that allows you to work with parameterized types, new TypeReference>(){}.getType().. details
    • Compared to Jackson it is more a matter of vision, jackson tries to handle a lot of cases but by making extension really hard, Genson takes another approach=> provide nice features but stay open to extension.. details
    • Here's their first goal, and it looks promising: Be as much extensible as possible by allowing users to add new functionnalities in a clean and easy way.. details
    • However all this stuff looks quite complex, if you are free to try another library you might want to have a look at Genson .To enable polymorphic types support you have to configure your Genson instance.. details
    • You don't need any configuration to enable json support with Genson, just drop the jar in your classpath.. details
    • You can have a look at Genson library , on the wiki page you will find some examples on how to use it.Since its first release it provides the streaming model and seems to be the fastest after Jackson, see the benchmarks .. details
    • EDIT**Here is another version shorter and nicer but not contained in the released version 0.91 (I will probably release the new version today as I am the author :))To make it work you will have to annotate your getters (and setters if you also do serialization) with @JsonProperty(the_name_from_json).. details
    • Its performances were not good (especially compared to Jackson or Genson).With the latest versions it has improved as they also provide a streaming api, but its still not fast enough.. details
  • 2. 2&q structure expect thing deserializers serializers require print count provide: 7
    • This is the shizzle!. details
    • @uegen yes, it is a powerful idea, glad to see genson also supports it!.. details
    • Thanks for the answer.. details
    • Great, I hope you will like it, in fact I am gensons author ).. details
    • 2&q [ & can=2&q=] Made things so much easier, no need for custom serializers/deserializers.. details
    • You could use a library providing databinding support.You can try Genson , it is fast, easy to use and has a couple of nice features.. details
    • It will not print exactly the structure you are expecting as it requires more code to count efficiently with your structure : CODESNIPPET .. details
  • 3. bit widely iphone exist stuff comment actual hmmm min advance: 5
    • Hmmm, Genson looks pretty handy.. details
    • Even if it's not clear from my comments, I think new stuff is good, and that Genson actual looks more solid than most new libs.. details
    • Took 2 mins to get it working and it does what I need!.. details
    • It is a bit like you were asking why try an android when iphone exists and is widely used.... details
    • Thanks in advance.. details
  • 4. jackson serialized gson content standard path shorten define conversion gensons: 9
    • Please show how you reload.. details
    • FWIW, almost all Java JSON libraries support this conversion mode, including GSON, Jackson and Genson.. details
    • Genson appears to support JSONAPI format.. details
    • Thank you so much, this helped a lot!. details
    • Very very good, I'm good impressed by your library (since seems that you are the developer)!!. details
    • But I don't know if your content is like that.. details
    • Also for doing json<>java databiding you can check Genson library , it integrates well with Jersey.. details
    • The serialized json will look like : {"content": {"@class":"package.path.Message", ...the object values...}} You can even define aliases for the serialized classes CODESNIPPET .. details
    • If you want to combine your two json objects into a single java object here is a solution with Genson library .The following code could be shortened and use Gensons standard converters but It would be less clear as an example.. details
  • 5. jackson add main gson truth equivalent write stick automatically classpath: 6
    • Try adding Genson to your classpath, it will automatically enable json support.. details
    • Truth is, I had begun writing some code in Jackson already, so if I can come up with something equivalent to what you have in genson, I will probably stick with Jackson.. details
    • However main advantages of Genson are : faster then Gson, more usefull features and is more flexible (you can add yourself new features in a more easy way).. details
    • This will work on Jackson as well as many other Java JSON libs (Gson, Genson at least), and will also be faster method to use.. details
    • If you don't want to use Genson, I really recommend you Jackson over Gson.. details
    • At the begining its main advantage was good support of Java generics but Jackson and Genson provide it too.. details
  • 6. jackson routinelistinjson binding stream gson answer idea thing mode bind: 20
    • Ah yes, pretty key that!.. details
    • I'll definitely look into that!.. details
    • My understanding of data-binding was that it automatically converted the respective values from the JSON and stored it in the Java object.. details
    • Thanks.. details
    • Thanks, it works.. details
    • String routineListInJSON; routineListInJSON genson.serialize(tempSaveObject); editor.putString(ROUTINE_LIST, routineListInJSON).commit(); I will have a play around with it and check out those resources - any ideas yourself though would also be well received!. details
    • Ok fair enough!. details
    • Thanks!. details
    • Ok, thanks for confirm that, I will report the issue.. details
    • I know that at least following support this mode of operation: Jackson Gson Genson For Jackson, basic Streaming API usage is talked about here (for example); but one thing that does not show is how to bind objects once you are positioned at the right place.So assuming JSON like: CODESNIPPET .. details
    • I'll take a look though thanks.. details
    • Thank you sir!. details
    • Thats why Genson has been created and this is one of main advantages of Genson over Jackson.. details
    • I hope however that you will also try Genson.... details
    • Thanks for the help!.. details
    • Thanks, I'll definitely take a look!. details
    • But I have to accept above answer because he replied first but appreciate your effort too thanks!. details
    • Hope this helps!. details
    • You can try Genson library .I just tested your code with it and it works fine the output is {"name":"foo"} CODESNIPPET .. details
    • Here are more good choices: Jackson -- 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 .. details
  • 7. conversion case jackson question stream mgibson range process full simple: 7
    • @mgibson cool waiting towards your feedback :) if you have questions on genson you can read the wiki and use its google group to ask for help.. details
    • Or if you want genson to use only fields instead of public getter/setter and fields, configure it like that: CODESNIPPET .. details
    • I fixed the questions, thanks.. details
    • And as a bonus with jersey you only need to have genson in your classpath and voila!. details
    • If you are not tied to jackson you could also try Genson .In your case there are two main advantages: you will not loose in performance, it should be easier to implement.. details
    • It uses streaming api instead of a dom model that brings better scalability and is nice in web applications where you can handle the conversion as the input arrives.. details
    • Genson is well suited for all kind of use cases, ranging from simple conversion, to full customization of all the process.. details
  • 8. download box polymorphic answer close exist mgibson find judge produce: 5
    • @mgibson great you like it :) yeah sure if you use maven use the dependency from here Download, if you just want to dl the jar you can find it here (you have a download link there).. details
    • Genson goal is indeed to answer to problems not handled by existing libraries (the initial one was extension) now it is also important that people try it out and judge by them self if it is good or not.. details
    • You could also try out Genson library, handling polymorphic types is supported out of the box.. details
    • Try for example Genson , it will work out of the box.The values in the json stream would be "Close", "Indeterminate", etc and when deserializing it will produce the correct enum.. details
    • You might also want to try Genson-lib .I just checked your example with it, and everything seems to work fine.To enable polymorphic types support in Genson you need to configure your genson instance: CODESNIPPET .. details
  • 9. reason jackson answer model call add couple apply beanview deserialize: 5
    • The reason I asked was exactly to give reasons above and beyond established choices -- maturity is valuable too, and AFAIK Genson is a very new lib.. details
    • That's a great tip, thanks!. details
    • This is a good answer, but if you don't want to use other libraries, you could also add a private member to GeneralTemplate which contains the class name as string.. details
    • Any particular reason to try Genson instead of proven and widely used packages like Jackson or GSON?. details
    • It has a couple of nice features that do not exisit in other librairies.Such as using constructor with arguments without any annotation or applying what is called BeanView on your objects at runtime (acts a as view of your model), can deserialize to concrete types, and more... Take a look at the wiki .. details
  • 0. item pojos require individual input finally sequence consist key immutable: 3
    • Have a look at Genson library some of its key features are adressing your exact problem: polymorphism, not requiring annotations and most important immutable pojos.. details
    • Finally, if your input consists of a sequence of items, there are even better ways to slice it up (which can be done regardless of whether individual items would be JsonNode s or POJOs!).. details
    • In addition it weights as much as gson (200K).An example with Genson for your problem: CODESNIPPET .. details
  • 1. gson databinding jackson note implement extensible extension single rewrite find: 3
    • you can also have a look at genson /, it is easy to use, provides streaming api/databinding, can deserialize even if there is no default ctr and much more.. details
    • It doesnt require you to write additional code, it should work like what you have now but without any weird result.. details
    • Note also that Gson comes with less features out of the box than Genson or Jackson.I also tried to implement the features I needed in Gson but I found that the Beans databinding part was not extensible (near everything in a single class with no extension points), so I would have to rewrite it.. details
  • 2. lot jsonserdesersymetrictest representation jersey 2b80106be551560dd27cef4197de0d0500e93439 builder define addalias argument browse: 5
    • This is an example unit test: nson/JsonSerDeserSymetricTest.java?r=2b80106be551560dd27cef4197de0d0500e93439 [JsonSerDeserSymetricTest.java] demonstrating deserialising a feed into classes.. details
    • Here is an example on how to implement a bodywriter/reader /genson/source/browse/src/main/java/com/owlike/genson/ext/jersey/GensonJsonCon verter.java.. details
    • will definitely give it a shot.. details
    • Also if you don't want impl details to leak in the json representation, you can define aliases (builder.addAlias("someAlias", SomeClass.class) for your types, they will be used instead of full package+classname.. details
    • You can configure a lot of things (use fields and/or methods, use constructor with arguments and without any annotation, filter properties by visibility and a lot more).. details
  • 3. solve ctr gensons configuration parameter previous jsonproperty trunk mgibson match: 3
    • @mgibson by the way you should not get source code for libs and package it your self, as the code in the trunk is not matching the released version.. details
    • Putting @JsonProperty("name") on the ctr parameter and using gensons previous configuration solved the problem.. details
    • Have a look at Genson library .If your classes are inner classes make them static.The following code should solve your problem.. details
  • 4. solve jackson bean feed getter setter nson owlike jersey 2b80106be551560dd27cef4197de0d0500e93439: 11
    • The classes include: nson/bean/Feed.java?r=2b80106be551560dd27cef4197de0d0500e93439 [Feed.java] - which has an id field est/java/com/owlike/genson/bean/Link.java?r=2b80106be551560dd27cef4197de0d0500 e93439 [Link.java] - which has a href field Genson will integrate with Spring-MVC and Jersey-for-JAX- RS] .. details
    • But that maturity comes is nonsense.. details
    • Indeed Genson is a new lib and Genson has most of Jackson features and others, for a new library I think it is quite serious!. details
    • This example is mainly intended to show how to use the streaming api of genson and give a hint on how to solve your problem.. details
    • Normally I would use GSON or Genson to map this back to a Java POJO, but this is the only area of the code where I have to do this and I want to be lazy here ;-).. details
    • You can try to replace jackson by Genson on the server side, it should solve your problem.. details
    • Here is how you can solve your problem with genson (for this example it is quite similar to jackson): CODESNIPPET .. details
    • Otherwise you could use a Genson instance to parse your file directly to java objects, but in your case I don't think it is the right solution as it will require you to store all the objects in memory!. details
    • Note that Genson does not need any getter/setter if you want it can only use the fields (by default it uses getter/setter if avaible otherwise the field).. details
    • You could file a bug -- if Genson can handle it, Jackson should too.. details
    • Disclaimer: I'm the author of the library but I try to be objective (especially in the benchmarks).. details
Summaries of the opinions about genson using three algorithms (Textrank, Lexrank and Luhn) adopted from extractive summarization. Each algorithm was used once for the positive opinions and once for the negative opinions.
  • You might also want to try Genson lib I just checked your example with it, and everything seems to work fine To enable polymorphic types support in Genson you need to configure your genson instance: CODESNIPPET JAVA1 .
  • However all this stuff looks quite complex, if you are free to try another library you might want to have a look at Genson To enable polymorphic types support you have to configure your Genson instance .
  • It has a couple of nice features that do not exisit in other librairies Such as using constructor with arguments without any annotation or applying what is called BeanView on your objects at runtime (acts a as view of your model), can deserialize to concrete types, and more Take a look at the wiki .
  • EDIT**Here is another version shorter and nicer but not contained in the released version 0 91 (I will probably release the new version today as I am the author :))To make it work you will have to annotate your getters (and setters if you also do serialization) with @JsonProperty(the name from json) .
  • I hope however that you will also try Genson .
  • You can have a look at Genson library , on the wiki page you will find some examples on how to use it Since its first release it provides the streaming model and seems to be the fastest after Jackson, see the benchmarks .
  • If you are not tied to jackson you could also try Genson In your case there are two main advantages: you will not loose in performance, it should be easier to implement .
  • Actually Genson is faster and has more features than Gson and has performances close to jackson (but its a lot more lightweight) see .
  • I know that at least following support this mode of operation: Jackson Gson Genson For Jackson, basic Streaming API usage is talked about here (for example); but one thing that does not show is how to bind objects once you are positioned at the right place So assuming JSON like: CODESNIPPET JAVA1 .
  • You could use a library providing databinding support You can try Genson , it is fast, easy to use and has a couple of nice features .
  • Genson goal is indeed to answer to problems not handled by existing libraries (the initial one was extension) now it is also important that people try it out and judge by them self if it is good or not .
  • You might also want to try Genson lib I just checked your example with it, and everything seems to work fine To enable polymorphic types support in Genson you need to configure your genson instance: CODESNIPPET JAVA1 .
  • @mgibson great you like it :) yeah sure if you use maven use the dependency from here Download, if you just want to dl the jar you can find it here (you have a download link there) .
  • Another nice thing with Genson is that it gives you the ability to register aliases for your classes, so you do not have to make all the package info available in your stream .
  • However all this stuff looks quite complex, if you are free to try another library you might want to have a look at Genson To enable polymorphic types support you have to configure your Genson instance .
  • It has a couple of nice features that do not exisit in other librairies Such as using constructor with arguments without any annotation or applying what is called BeanView on your objects at runtime (acts a as view of your model), can deserialize to concrete types, and more Take a look at the wiki .
  • EDIT**Here is another version shorter and nicer but not contained in the released version 0 91 (I will probably release the new version today as I am the author :))To make it work you will have to annotate your getters (and setters if you also do serialization) with @JsonProperty(the name from json) .
  • If you want to combine your two json objects into a single java object here is a solution with Genson library The following code could be shortened and use Gensons standard converters but It would be less clear as an example .
  • You can have a look at Genson library , on the wiki page you will find some examples on how to use it Since its first release it provides the streaming model and seems to be the fastest after Jackson, see the benchmarks .
  • If you are not tied to jackson you could also try Genson In your case there are two main advantages: you will not loose in performance, it should be easier to implement .
  • You might also want to try Genson lib I just checked your example with it, and everything seems to work fine To enable polymorphic types support in Genson you need to configure your genson instance: CODESNIPPET JAVA1 .
  • @mgibson great you like it :) yeah sure if you use maven use the dependency from here Download, if you just want to dl the jar you can find it here (you have a download link there) .
  • Another nice thing with Genson is that it gives you the ability to register aliases for your classes, so you do not have to make all the package info available in your stream .
  • However all this stuff looks quite complex, if you are free to try another library you might want to have a look at Genson To enable polymorphic types support you have to configure your Genson instance .
  • It has a couple of nice features that do not exisit in other librairies Such as using constructor with arguments without any annotation or applying what is called BeanView on your objects at runtime (acts a as view of your model), can deserialize to concrete types, and more Take a look at the wiki .
  • EDIT**Here is another version shorter and nicer but not contained in the released version 0 91 (I will probably release the new version today as I am the author :))To make it work you will have to annotate your getters (and setters if you also do serialization) with @JsonProperty(the name from json) .
  • If you want to combine your two json objects into a single java object here is a solution with Genson library The following code could be shortened and use Gensons standard converters but It would be less clear as an example .
  • You can have a look at Genson library , on the wiki page you will find some examples on how to use it Since its first release it provides the streaming model and seems to be the fastest after Jackson, see the benchmarks .
  • If you are not tied to jackson you could also try Genson In your case there are two main advantages: you will not loose in performance, it should be easier to implement .
  • I know that at least following support this mode of operation: Jackson Gson Genson For Jackson, basic Streaming API usage is talked about here (for example); but one thing that does not show is how to bind objects once you are positioned at the right place So assuming JSON like: CODESNIPPET JAVA1 .
  • Normally I would use GSON or Genson to map this back to a Java POJO, but this is the only area of the code where I have to do this and I want to be lazy here ; ) .
  • Here is how you can solve your problem with genson (for this example it is quite similar to jackson): CODESNIPPET JAVA2 .
  • Putting @JsonProperty("name") on the ctr parameter and using gensons previous configuration solved the problem .
  • @mgibson by the way you should not get source code for libs and package it your self, as the code in the trunk is not matching the released version .
  • You can try to replace jackson by Genson on the server side, it should solve your problem .
  • Here is an example on how to implement a bodywriter reader genson source browse src main java com owlike genson ext jersey GensonJsonCon verter java .
  • This example is mainly intended to show how to use the streaming api of genson and give a hint on how to solve your problem .
  • Otherwise you could use a Genson instance to parse your file directly to java objects, but in your case I don't think it is the right solution as it will require you to store all the objects in memory!.
  • you can also have a look at genson , it is easy to use, provides streaming api databinding, can deserialize even if there is no default ctr and much more .
  • Note also that Gson comes with less features out of the box than Genson or Jackson I also tried to implement the features I needed in Gson but I found that the Beans databinding part was not extensible (near everything in a single class with no extension points), so I would have to rewrite it .
  • Normally I would use GSON or Genson to map this back to a Java POJO, but this is the only area of the code where I have to do this and I want to be lazy here ; ) .
  • Here is how you can solve your problem with genson (for this example it is quite similar to jackson): CODESNIPPET JAVA2 .
  • Indeed Genson is a new lib and Genson has most of Jackson features and others, for a new library I think it is quite serious!.
  • @mgibson by the way you should not get source code for libs and package it your self, as the code in the trunk is not matching the released version .
  • You can try to replace jackson by Genson on the server side, it should solve your problem .
  • Note that Genson does not need any getter setter if you want it can only use the fields (by default it uses getter setter if avaible otherwise the field) .
  • This example is mainly intended to show how to use the streaming api of genson and give a hint on how to solve your problem .
  • Otherwise you could use a Genson instance to parse your file directly to java objects, but in your case I don't think it is the right solution as it will require you to store all the objects in memory!.
  • you can also have a look at genson , it is easy to use, provides streaming api databinding, can deserialize even if there is no default ctr and much more .
  • Note also that Gson comes with less features out of the box than Genson or Jackson I also tried to implement the features I needed in Gson but I found that the Beans databinding part was not extensible (near everything in a single class with no extension points), so I would have to rewrite it .
  • Normally I would use GSON or Genson to map this back to a Java POJO, but this is the only area of the code where I have to do this and I want to be lazy here ; ) .
  • Here is how you can solve your problem with genson (for this example it is quite similar to jackson): CODESNIPPET JAVA2 .
  • Indeed Genson is a new lib and Genson has most of Jackson features and others, for a new library I think it is quite serious!.
  • The classes include: nson bean Feed java?r=2b80106be551560dd27cef4197de0d0500e93439 Feed java which has an id field est java com owlike genson bean Link java?r=2b80106be551560dd27cef4197de0d0500 e93439 Link java which has a href field Genson will integrate with Spring MVC and Jersey for JAX RS .
  • @mgibson by the way you should not get source code for libs and package it your self, as the code in the trunk is not matching the released version .
  • Note that Genson does not need any getter setter if you want it can only use the fields (by default it uses getter setter if avaible otherwise the field) .
  • This example is mainly intended to show how to use the streaming api of genson and give a hint on how to solve your problem .
  • Otherwise you could use a Genson instance to parse your file directly to java objects, but in your case I don't think it is the right solution as it will require you to store all the objects in memory!.
  • you can also have a look at genson , it is easy to use, provides streaming api databinding, can deserialize even if there is no default ctr and much more .
  • Note also that Gson comes with less features out of the box than Genson or Jackson I also tried to implement the features I needed in Gson but I found that the Beans databinding part was not extensible (near everything in a single class with no extension points), so I would have to rewrite it .
Summaries of the opinions about genson using Opinosis, an abstractive summarizer of opinions..
  • main advantages of genson .
  • couple of nice features .
Summaries of the opinions about genson using contrastive viewpoints. Each entry contains a pair of positive and negative sentences that are most likely discussing about similar API features.
    • Actually Genson is faster and has more features than Gson and has performances close to jackson (but its a lot more lightweight) see .
    • Indeed Genson is a new lib and Genson has most of Jackson features and others, for a new library I think it is quite serious!.
    • This will work on Jackson as well as many other Java JSON libs (Gson, Genson at least), and will also be faster method to use .
    • You could file a bug if Genson can handle it, Jackson should too .
    • If you don't want to use Genson, I really recommend you Jackson over Gson .
    • You could file a bug if Genson can handle it, Jackson should too .
    • I hope however that you will also try Genson .
    • Have a look at Genson library If your classes are inner classes make them static The following code should solve your problem .
    • You don't need any configuration to enable json support with Genson, just drop the jar in your classpath .
    • Have a look at Genson library If your classes are inner classes make them static The following code should solve your problem .
Summaries of opinions about based on specific API aspects, such as, performance, usability, etc. The 'Overview' page provides an overview of the aspects detected in the opinions. The 'Trend' page shows the distribution of polarity over time for each aspect. The 'Positive Opinions' page groups positive opinions by the detected aspects. The 'Contrastive By Aspect' page shows paris of contrastive opinions under each aspect (where found).
Features:
  • Took 2 mins to get it working and it does what I need!.
  • N/A
Documentation:
  • @mgibson great you like it :) yeah sure if you use maven use the dependency from here URL_http://code.google.com/p/genson/wiki/GettingStarted Download, if you just want to dl the jar you can find it here URL_http://mvnrepository.com/artifact/com.owlike/genson/0.94 (you have a download link there).
  • This is an example unit test: URL_https://code.google.com/p/genson/source/browse/src/test/java/com/owlike/ge nson/JsonSerDeserSymetricTest.java?r=2b80106be551560dd27cef4197de0d0500e93439 [JsonSerDeserSymetricTest.java] demonstrating deserialising a feed into classes.
Community:
  • It is a bit like you were asking why try an android when iphone exists and is widely used...
  • N/A
Onlysentiment:
  • Ok, thanks for confirm that, I will report the issue.
  • will definitely give it a shot.
Performance:
  • Compared to Jackson it is more a matter of vision, jackson tries to handle a lot of cases but by making extension really hard, Genson takes another approach=> provide nice features but stay open to extension.
  • N/A
Bug:
  • N/A
  • Putting @JsonProperty("name") on the ctr parameter and using gensons previous configuration solved the problem.
Usability:
  • Anyway, thanks for listing expected benefits, this is better than just suggesting using another lib without justification.
  • @mgibson by the way you should not get source code for libs and package it your self, as the code in the trunk is not matching the released version.
  • Features: 8
    1. general: 8
      • Please show how you reload.. details
      • Ah yes, pretty key that!.. details
      • Hmmm, Genson looks pretty handy.. details
      • Took 2 mins to get it working and it does what I need!.. details
      • Ok fair enough!. details
      • I hope however that you will also try Genson.... details
      • This is very close to what I'm trying to accomplish.. details
      • The serialized json will look like : {"content": {"@class":"package.path.Message", ...the object values...}} You can even define aliases for the serialized classes CODESNIPPET_JAVA2 .. details
  • Documentation: 4
    1. general: 4
      • @mgibson great you like it :) yeah sure if you use maven use the dependency from here URL_http://code.google.com/p/genson/wiki/GettingStarted Download, if you just want to dl the jar you can find it here URL_http://mvnrepository.com/artifact/com.owlike/genson/0.94 (you have a download link there).. details
      • But I have to accept above answer because he replied first but appreciate your effort too thanks!. details
      • You can have a look at Genson library URL_http://code.google.com/p/genson/ [ URL_http://code.google.com/p/genson/ ] , on the wiki page you will find some examples on how to use it.Since its first release it provides the streaming model and seems to be the fastest after Jackson, see the URL_http://code.google.com/p/genson/wiki/Metrics2 [benchmarks] .. details
      • If you want to combine your two json objects into a single java object here is a solution with Genson library URL_http://code.google.com/p/genson/ [ URL_http://code.google.com/p/genson/ ] .The following code could be shortened and use Gensons standard converters but It would be less clear as an example.. details
  • Community: 3
    1. general: 3
      • It is a bit like you were asking why try an android when iphone exists and is widely used.... details
      • Great, I hope you will like it, in fact I am gensons author ).. details
      • Hope this helps!. details
  • Onlysentiment: 18
    1. report: 1
      • Ok, thanks for confirm that, I will report the issue.. details
    2. general: 17
      • That's a great tip, thanks!. details
      • Thanks, it works.. details
      • Thanks.. details
      • Thanks!. details
      • This is the shizzle!. details
      • Anyway, thanks for listing expected benefits, this is better than just suggesting using another lib without justification.. details
      • I'll definitely look into that!.. details
      • I fixed the questions, thanks.. details
      • Thanks for the answer.. details
      • I'll take a look though thanks.. details
      • Thank you sir!. details
      • Thank you so much, this helped a lot!. details
      • Thanks for the help!.. details
      • Great, I hope you will like it, in fact I am gensons author ).. details
      • Thanks, I'll definitely take a look!. details
      • Very very good, I'm good impressed by your library (since seems that you are the developer)!!. details
      • Thanks in advance.. details
  • Performance: 5
    1. general: 5
      • However main advantages of Genson are : faster then Gson, more usefull features and is more flexible (you can add yourself new features in a more easy way).. details
      • Compared to Jackson it is more a matter of vision, jackson tries to handle a lot of cases but by making extension really hard, Genson takes another approach=> provide nice features but stay open to extension.. details
      • This will work on Jackson as well as many other Java JSON libs (Gson, Genson at least), and will also be faster method to use.. details
      • Actually Genson is faster and has more features than Gson and has performances close to jackson (but its a lot more lightweight) see URL_http://code.google.com/p/genson/wiki/Metrics [ URL_http://code.google.com/p/genson/wiki/Metrics ] .. details
      • Its performances were not good (especially compared to Jackson or Genson).With the latest versions it has improved as they also provide a streaming api, but its still not fast enough.. details
  • Usability: 57
    1. jackson: 9
      • Truth is, I had begun writing some code in Jackson already, so if I can come up with something equivalent to what you have in genson, I will probably stick with Jackson.. details
      • Like Genson GenericType, jackson provides a class called TypeReference that allows you to work with parameterized types, new TypeReference>(){}.getType().. details
      • Compared to Jackson it is more a matter of vision, jackson tries to handle a lot of cases but by making extension really hard, Genson takes another approach=> provide nice features but stay open to extension.. details
      • Any particular reason to try Genson instead of proven and widely used packages like Jackson or GSON?. details
      • If you are not tied to jackson you could also try Genson URL_http://code.google.com/p/genson/ [ URL_http://code.google.com/p/genson/ ] .In your case there are two main advantages: you will not loose in performance, it should be easier to implement.. details
      • Actually Genson is faster and has more features than Gson and has performances close to jackson (but its a lot more lightweight) see URL_http://code.google.com/p/genson/wiki/Metrics [ URL_http://code.google.com/p/genson/wiki/Metrics ] .. details
      • At the begining its main advantage was good support of Java generics but Jackson and Genson provide it too.. details
      • If you don't want to use Genson, I really recommend you Jackson over Gson.. details
      • Its performances were not good (especially compared to Jackson or Genson).With the latest versions it has improved as they also provide a streaming api, but its still not fast enough.. details
    2. string: 1
      • String routineListInJSON; routineListInJSON genson.serialize(tempSaveObject); editor.putString(ROUTINE_LIST, routineListInJSON).commit(); I will have a play around with it and check out those resources - any ideas yourself though would also be well received!. details
    3. package: 1
      • Another nice thing with Genson is that it gives you the ability to register aliases for your classes, so you do not have to make all the package info available in your stream.. details
    4. general: 25
      • Thanks, it works.. details
      • @uegen yes, it is a powerful idea, glad to see genson also supports it!.. details
      • The reason I asked was exactly to give reasons above and beyond established choices -- maturity is valuable too, and AFAIK Genson is a very new lib.. details
      • Anyway, thanks for listing expected benefits, this is better than just suggesting using another lib without justification.. details
      • @mgibson cool waiting towards your feedback :) if you have questions on genson you can read the wiki and use its google group to ask for help.. details
      • Even if it's not clear from my comments, I think new stuff is good, and that Genson actual looks more solid than most new libs.. details
      • Genson appears to support JSONAPI format.. details
      • Or if you want genson to use only fields instead of public getter/setter and fields, configure it like that: CODESNIPPET_JAVA1 .. details
      • Thank you so much, this helped a lot!. details
      • Genson goal is indeed to answer to problems not handled by existing libraries (the initial one was extension) now it is also important that people try it out and judge by them self if it is good or not.. details
      • Thats why Genson has been created and this is one of main advantages of Genson over Jackson.. details
      • However main advantages of Genson are : faster then Gson, more usefull features and is more flexible (you can add yourself new features in a more easy way).. details
      • Genson applies the philosophy that "We can not think of every use case, so give to users the ability to do it by them self in a easy way"... details
      • Here's their first goal, and it looks promising: Be as much extensible as possible by allowing users to add new functionnalities in a clean and easy way.. details
      • Take a look at URL_http://code.google.com/p/genson/ [Genson] it provides full databinding support, with polymorphic and untyped objects and has many other features.. details
      • But I have to accept above answer because he replied first but appreciate your effort too thanks!. details
      • Very very good, I'm good impressed by your library (since seems that you are the developer)!!. details
      • URL_https://code.google.com/p/genson/downloads/detail?name=genson-0.94.jar&can 2&q [ URL_https://code.google.com/p/genson/downloads/detail?name=genson-0.94.jar & can=2&q=] Made things so much easier, no need for custom serializers/deserializers.. details
      • But I don't know if your content is like that.. details
      • Also for doing json<>java databiding you can check Genson library URL_http://code.google.com/p/genson/ [ URL_http://code.google.com/p/genson/ ] , it integrates well with Jersey.. details
      • You could use a library providing databinding support.You can try Genson URL_http://code.google.com/p/genson/ [ URL_http://code.google.com/p/genson/ ] , it is fast, easy to use and has a couple of nice features.. details
      • It will not print exactly the structure you are expecting as it requires more code to count efficiently with your structure : CODESNIPPET_JAVA1 .. details
      • EDIT**Here is another version shorter and nicer but not contained in the released version 0.91 (I will probably release the new version today as I am the author :))To make it work you will have to annotate your getters (and setters if you also do serialization) with @JsonProperty(the_name_from_json).. details
      • However xml support may be added in a future version.. details
      • Genson is well suited for all kind of use cases, ranging from simple conversion, to full customization of all the process.. details
    5. maven: 1
      • @mgibson great you like it :) yeah sure if you use maven use the dependency from here URL_http://code.google.com/p/genson/wiki/GettingStarted Download, if you just want to dl the jar you can find it here URL_http://mvnrepository.com/artifact/com.owlike/genson/0.94 (you have a download link there).. details
    6. jersey: 1
      • And as a bonus with jersey you only need to have genson in your classpath and voila!. details
    7. json: 8
      • FWIW, almost all Java JSON libraries support this conversion mode, including GSON, Jackson and Genson.. details
      • My understanding of data-binding was that it automatically converted the respective values from the JSON and stored it in the Java object.. details
      • Try adding URL_http://code.google.com/p/genson/ [Genson] to your classpath, it will automatically enable json support.. details
      • I know that at least following support this mode of operation: Jackson Gson Genson For Jackson, basic Streaming API usage is talked about URL_http://www.cowtowncoder.com/blog/archives/2009/01/entry_132.html [here] (for example); but one thing that does not show is how to bind objects once you are positioned at the right place.So assuming JSON like: CODESNIPPET_JAVA1 .. details
      • This will work on Jackson as well as many other Java JSON libs (Gson, Genson at least), and will also be faster method to use.. details
      • Try for example URL_http://code.google.com/p/genson/ [Genson] , it will work out of the box.The values in the json stream would be "Close", "Indeterminate", etc and when deserializing it will produce the correct enum.. details
      • You don't need any configuration to enable json support with Genson, just drop the jar in your classpath.. details
      • If you want to combine your two json objects into a single java object here is a solution with Genson library URL_http://code.google.com/p/genson/ [ URL_http://code.google.com/p/genson/ ] .The following code could be shortened and use Gensons standard converters but It would be less clear as an example.. details
    8. annotations: 1
      • You also have URL_http://code.google.com/p/genson/ [Genson] lib that has nice features, perfs, provides alternatives to annotations and is easy to use.. details
    9. serialization: 1
      • Here are more good choices: URL_http://wiki.fasterxml.com/JacksonHome [Jackson] -- powerful data binding (JSON to/from POJOs), streaming (ultra fast), tree model (convenient for untyped access) URL_http://flexjson.sourceforge.net/ [Flex-JSON] -- highly configurable serialization EDIT (Aug/2013): One more to consider: URL_http://code.google.com/p/genson/ [Genson] -- functionality similar to Jackson, aimed to be easier to configure by developer .. details
    10. streaming: 2
      • You can have a look at Genson library URL_http://code.google.com/p/genson/ [ URL_http://code.google.com/p/genson/ ] , on the wiki page you will find some examples on how to use it.Since its first release it provides the streaming model and seems to be the fastest after Jackson, see the URL_http://code.google.com/p/genson/wiki/Metrics2 [benchmarks] .. details
      • It uses streaming api instead of a dom model that brings better scalability and is nice in web applications where you can handle the conversion as the input arrives.. details
    11. output: 1
      • You can try Genson library URL_http://code.google.com/p/genson/ [ URL_http://code.google.com/p/genson/ ] .I just tested your code with it and it works fine the output is {"name":"foo"} CODESNIPPET_JAVA1 .. details
    12. android: 1
      • It is a bit like you were asking why try an android when iphone exists and is widely used.... details
    13. class: 1
      • This is a good answer, but if you don't want to use other libraries, you could also add a private member to GeneralTemplate which contains the class name as string.. details
    14. types: 3
      • You could also try out URL_http://code.google.com/p/genson/ [Genson] library, handling polymorphic types is supported out of the box.. details
      • However all this stuff looks quite complex, if you are free to try another library you might want to have a look at URL_http://code.google.com/p/genson/ [Genson] .To enable polymorphic types support you have to configure your Genson instance.. details
      • You might also want to try URL_http://code.google.com/p/genson/ [Genson-lib] .I just checked your example with it, and everything seems to work fine.To enable polymorphic types support in Genson you need to configure your genson instance: CODESNIPPET_JAVA1 .. details
    15. view: 1
      • It has a couple of nice features that do not exisit in other librairies.Such as using constructor with arguments without any annotation or applying what is called BeanView on your objects at runtime (acts a as view of your model), can deserialize to concrete types, and more... Take a look at the wiki URL_http://code.google.com/p/genson/wiki/GettingStarted [ URL_http://code.google.com/p/genson/wiki/GettingStarted ] .. details
  • Onlysentiment: 1
    1. general: 1
      • will definitely give it a shot.. details
  • Documentation: 2
    1. general: 2
      • This is an example unit test: URL_https://code.google.com/p/genson/source/browse/src/test/java/com/owlike/ge nson/JsonSerDeserSymetricTest.java?r=2b80106be551560dd27cef4197de0d0500e93439 [JsonSerDeserSymetricTest.java] demonstrating deserialising a feed into classes.. details
      • Here is an example on how to implement a bodywriter/reader URL_http://code.google.com/p /genson/source/browse/src/main/java/com/owlike/genson/ext/jersey/GensonJsonCon verter.java.. details
  • Bug: 2
    1. general: 2
      • Putting @JsonProperty("name") on the ctr parameter and using gensons previous configuration solved the problem.. details
      • You could file a bug -- if Genson can handle it, Jackson should too.. details
  • Usability: 22
    1. properties: 1
      • You can configure a lot of things (use fields and/or methods, use constructor with arguments and without any annotation, filter properties by visibility and a lot more).. details
    2. jackson: 3
      • Indeed Genson is a new lib and Genson has most of Jackson features and others, for a new library I think it is quite serious!. details
      • You can try to replace jackson by URL_http://code.google.com/p/genson/ [Genson] on the server side, it should solve your problem.. details
      • You could file a bug -- if Genson can handle it, Jackson should too.. details
    3. package: 1
      • @mgibson by the way you should not get source code for libs and package it your self, as the code in the trunk is not matching the released version.. details
    4. general: 8
      • The classes include: URL_https://code.google.com/p/genson/source/browse/src/test/java/com/owlike/ge nson/bean/Feed.java?r=2b80106be551560dd27cef4197de0d0500e93439 [Feed.java] - which has an id field URL_https://code.google.com/p/genson/source/browse/src/t est/java/com/owlike/genson/bean/Link.java?r=2b80106be551560dd27cef4197de0d0500 e93439 [Link.java] - which has a href field Genson will integrate with URL_https://code.google.com/p/genson/wiki/SpringIntegration [Spring-MVC] and URL_https://code.google.com/p/genson/wiki/JerseyIntegration [Jersey-for-JAX- RS] .. details
      • But that maturity comes is nonsense.. details
      • Finally, if your input consists of a sequence of items, there are even better ways to slice it up (which can be done regardless of whether individual items would be CODETERM3 s or POJOs!).. details
      • It doesnt require you to write additional code, it should work like what you have now but without any weird result.. details
      • Have a look at Genson library URL_http://code.google.com/p/genson/ [ URL_http://code.google.com/p/genson/ ] .If your classes are inner classes make them static.The following code should solve your problem.. details
      • Here is how you can solve your problem with genson (for this example it is quite similar to jackson): CODESNIPPET_JAVA2 .. details
      • Note that Genson does not need any getter/setter if you want it can only use the fields (by default it uses getter/setter if avaible otherwise the field).. details
      • Disclaimer: I'm the author of the library but I try to be objective (especially in the benchmarks).. details
    5. streaming: 2
      • you can also have a look at genson URL_http://code.google.com/p/genson /, it is easy to use, provides streaming api/databinding, can deserialize even if there is no default ctr and much more.. details
      • This example is mainly intended to show how to use the streaming api of genson and give a hint on how to solve your problem.. details
    6. json: 1
      • Also if you don't want impl details to leak in the json representation, you can define aliases (builder.addAlias("someAlias", SomeClass.class) for your types, they will be used instead of full package+classname.. details
    7. annotations: 1
      • Have a look at URL_http://code.google.com/p/genson/wiki/GettingStarted [Genson] library some of its key features are adressing your exact problem: polymorphism, not requiring annotations and most important immutable pojos.. details
    8. file: 1
      • Otherwise you could use a Genson instance to parse your file directly to java objects, but in your case I don't think it is the right solution as it will require you to store all the objects in memory!. details
    9. configuration: 1
      • Putting @JsonProperty("name") on the ctr parameter and using gensons previous configuration solved the problem.. details
    10. gson: 3
      • Normally I would use GSON or Genson to map this back to a Java POJO, but this is the only area of the code where I have to do this and I want to be lazy here ;-).. details
      • In addition it weights as much as gson (200K).An example with Genson for your problem: CODESNIPPET_JAVA1 .. details
      • Note also that Gson comes with less features out of the box than Genson or Jackson.I also tried to implement the features I needed in Gson but I found that the Beans databinding part was not extensible (near everything in a single class with no extension points), so I would have to rewrite it.. details
  • Usability
    1. Try adding URL_http://code.google.com/p/genson/ [Genson] to your classpath, it will automatically enable json support.
      • Have a look at Genson library URL_http://code.google.com/p/genson/ [ URL_http://code.google.com/p/genson/ ] .If your classes are inner classes make them static.The following code should solve your problem.
    2. Have a look at Genson library URL_http://code.google.com/p/genson/ [ URL_http://code.google.com/p/genson/ ] .If your classes are inner classes make them static.The following code should solve your problem.
      • You can try Genson library URL_http://code.google.com/p/genson/ [ URL_http://code.google.com/p/genson/ ] .I just tested your code with it and it works fine the output is {"name":"foo"} CODESNIPPET_JAVA1 .