Java Code to XML/XSD without using Annotation

后端 未结 3 1253
一个人的身影
一个人的身影 2020-12-30 07:40

I need to marshall and unmarshall a Java class to XML. The class in not owned by me, that I cannot add anotations so that I can use JAXB.

Is there a good way to conv

3条回答
  •  不思量自难忘°
    2020-12-30 08:07

    Have you looked at XStream ? It will deserialise/deserialise a standard POJO without annotations or XSDs. You can provide customisations to affect how elements appear in the XML and pretty much works out-of-the-box.

提交回复
热议问题