tags:

views:

810

answers:

2

I was just wondering if there was a library out there which could generate a xsd schema from a java class . Google yields lots of results the opposite ( java classes from xsd ).

+2  A: 

JiBX does this

The schema generator tool first reads one or more JiBX binding definitions and then uses reflection to interpret the structure of the Java classes referenced in the bindings. By combining the binding definitions with the actual class information the schema generator is able to construct one or more XML schemas to represent the documents handled by the bindings.

skaffman
+4  A: 

JAXB 2.0 allows you to create a XML schema from an annotated Java class.

You'll find some examples at the AMIS blog and at the JavaPassion site.

Vineet Reynolds
I'm supposed to be a JAXB expert, and I didn't know that. How embarrassing. +1 to you, sir.
skaffman
There was some amount of google-fu involved :) No reason to be surprised there.
Vineet Reynolds
Cool thanks. My google fu is weak.
Surya