• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Java Bean Mapper !!!!!

 
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Which mapper open source library is recommended or Top 2 in Java for the following?

1. Send same payload with different value object based on each client
2. Send different payload json based on each client
 
Saloon Keeper
Posts: 15617
366
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Top 2 ranked by what exactly?

What do you mean by "same payload with different value object"?

What do you mean by "based on each client"?

It's best if you simply explain to us what you're trying to achieve.

Anyway, if your goal is simply to serialize Java objects to JSON, then I strongly recommend using JSON-B and its reference implementation Eclipse Yasson.
 
Matthew Henry
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is JSON-B is better than Jackson ?
 
Marshal
Posts: 28261
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I found a page on line which said

In summary, both libraries can be used for parsing and generating JSON data in Java. However, Jackson is a more mature library with more features and customizations, while JSON-B is a more recent library and is designed to be more simple to use, it is an official standard for JSON binding in Java.


It also had some text which described the two in more detail. So I don't know, you'd have to interpret that statement to see how it matches your definition of "better".
 
Stephan van Hulst
Saloon Keeper
Posts: 15617
366
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
JSON-B is a specification, while Jackson is a collection of libraries. There's no one-to-one comparison. A better comparison would be between Yasson and Jackson.

But again, better in what regard? What qualities matter to you?

Many people would opt for Jackson because it is a very widely used library, but personally I prefer a JSON-B implementation like Yasson exactly because it implements the JSON-B spec, which is maintained by the Jakarta EE community.

JSON-B has only one concern, and that is mapping JSON to Java. Jackson on the other hand has grown beyond its initial scope and concerns itself with mapping to other data formats as well. That can be considered both a pro and a con.
 
Matthew Henry
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you and will go with Jackson for mapping with Java.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic