How to generate JAXB classes from XSD?

Viewed 306558

I'm a total newbie with XML. I'm doing a Java EE project REST implementation and we return a lot of XML. With this we decided to use JAXB. So far, we manually coded the Models for the XML.

But there are already these complex structures we don't know how to code. We've read about generating classes from XSD. We do have an XSD.

My questions:

1.) I've read about XJC, where can I find it?

2.) Do we have to install the whole JAXB? (so what we used so far? isn't this JAXB?)

10 Answers

In intellij click .xsd file -> WebServices ->Generate Java code from Xml Schema JAXB then give package path and package name ->ok

Note that the required plugin is: Java EE: Web Services (JAX-WS) (bundled)

Related