Help coderanch get a
new server
by contributing to the fundraiser
  • 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
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

Marshalling/Unmarshalling JSON or XML

 
Ranch Hand
Posts: 70
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Congrats Alex Soto Bueno & Jason Porter on your new book:
Quarkus Cookbook: Kubernetes-Optimized Java Solutions

On the topic of: Marshalling/Unmarshalling

Are there built in Handler functions to automate the process of writing Java objects to XML file (Marshalling) or converting XML content to Java objects (Unmarshalling)?

How "manual" is this process? Are there Handler functions to simplify and streamline the process?

Thanks!
 
Saloon Keeper
Posts: 15702
367
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Not one of the authors, but I was wondering what you mean by built-in. Built in what?

You can very easily marshal and unmarshal Java objects to and from XML using JAX-B. Some application containers provide a JAX-B implementation by default, and for others you need to bundle one with your application.
 
Geoff McKay
Ranch Hand
Posts: 70
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Stephan,

Thanks! That answers my question.
Just looked into the JAXB Handler (Helper Class), and that's the solution I was looking for.
Appreciated

Stephan van Hulst wrote:... You can very easily marshal and unmarshal Java objects to and from XML using JAX-B. ...

 
Author
Posts: 134
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Quarkus has support for both JAX-B implementations and Jackson.
 
Saloon Keeper
Posts: 28054
198
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Have I got my terminology wrong, or wasn't JAXB part of the core JVM up until about Java 11?
 
Stephan van Hulst
Saloon Keeper
Posts: 15702
367
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That is correct. JAXB became a separate module around the time of Java SE 9, where it was still included in the JDK but marked as a deprecated module. It was fully removed from Java SE 11.

Later, it became a part of Jakarta EE 9.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic