• 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

Jackson Libraries.

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I would like to use Jackson to Create and object and then spit out custom views of that Object dynamically.
Json Object Definition Example <Json Format> -> To ExamplePOJO -> Input Java Object (result set) -> Map to ExamplePOJO -> Custom Json Output 1 or Custom Json Output 2..


Whats the best way to do this.
I will have 1 definition for the POJO and multiple output formats for the POJO that is generated.
 
Bartender
Posts: 3648
16
Android Mac OS X Firefox Browser Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to the Ranch.

When you say "custom views of that object dynamically", are you simply want to convert the JSON to "any" Java POJO/class and vice versa?

If so, Jackson has that ObjectMapper class to do such things.

I've been using Jackson for a bit now and had written a few utility functions to do such conversion (from/to POJO and from/to collections). The collection version is indeed trickier.

 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic