質問

I have been doing research on JAXB and XJC but from the documentation that is out there, including the Oracle pages and some of the Stack Overflow questions here, I don't think there is a clear definition of what is the difference between JAXB and XJC and how to use it to convert an XML file to an object.

So from my understanding JAXB is method for XML -> Java parsing and vice versa and xjc is one implementation for it that is included in the java tools?

役に立ちましたか?

解決

JAXB (JSR-222) implementations convert instances of Java classes (that may contain annotations) to/from XML. XJC (XML to Java Compiler) is a utility for generating those objects from an XML schema. It is included as part of the JDK since Java SE 6.

Exanple

Here is a link to my blog that demonstrates how to generate a Java model from an XML Schema:

他のヒント

Not sure this is what you're after but it seems close...

Use Java Architecture for XML Binding (JAXB) xjc tooling to compile an XML schema file into fully annotated Java classes.

https://www.ibm.com/support/knowledgecenter/SSEQTP_8.5.5/com.ibm.websphere.base.doc/ae/twbs_jaxbschema2java.html

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top