views:

38

answers:

2

How to create a JAXB java class out of a xml schema using a utility? I don't like reverse-engineering of several huge XSD-files to a JAXB-compliant java class.

I know there's the jdk utility schemagen - but this works the other way round. What tool can help me?

+2  A: 

You want the xjc tool. It sits alongside schemagen in the JDK, and generates JAXB-annotated java from an XML Schema. See official JavaSE docs here.

skaffman
+4  A: 

You can use the command line xjc tool or the ant task version:

http://java.sun.com/webservices/docs/2.0/jaxb/xjc.html

Alexandru Luchian