Generate Java class from XML file, using XStream

前端 未结 3 1500
春和景丽
春和景丽 2021-01-04 12:16

I have many xml files and I would like to use XStream to manage them. Is it possible to generate java classes corresponding to my xml files using XStream?

3条回答
  •  Happy的楠姐
    2021-01-04 13:09

    I think it's not possible using XStream but I've already done it using JAXB.

    Basically, the steps are generating a xsd from the xml files and then generating the Java classes from the xsd.

    Have a look at this tutorial:

    http://theopentutorials.com/examples/java/jaxb/generate-java-class-from-xml-schema-using-jaxb-xjc-command/

提交回复
热议问题