• 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
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

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!
 
Bartender
Posts: 15743
368
  • 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: 28757
211
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
Bartender
Posts: 15743
368
  • 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.
reply
    Bookmark Topic Watch Topic
  • New Topic