I am trying to generate java classes from sample xsd using jdk 1.6, xjc command.
But I don't want to use annotations i.e I don't want to generated java classes to contain annotations. How can I do it?
解决方案
This question has two parts:
In the compile time you have to generate your code differently. You can write an XJC plugin to do this.
In the runtime you have to use the JAXB implementation which works without annotations (see Blaise's answer on this part).
See this question on XJC extensibility:
You can write an XJC plugin which completely replaces the code generation. So I can imagine an XJC plugin which generates XML mappings for MOXy instead of annotations in classes. You can also do this with JAXB RI using an extra annotation reader, but it is much trickier as simply using MOXy.
Be warned, however, that writing advanced XJC plugins my be quite complex.