Saving Java Object Graphs as XML file

前端 未结 15 2532
耶瑟儿~
耶瑟儿~ 2021-02-07 12:13

What\'s the simplest-to-use techonlogy available to save an arbitrary Java object graph as an XML file (and to be able to rehydrate the objects later)?

15条回答
  •  南方客
    南方客 (楼主)
    2021-02-07 13:10

    Simple

    Although XStream and JAXB can serialize an some object graphs succssfully they can not handle very complex graphs. The most powerful solution for large complex graphs is Simple XML Serialization. It can handle any graph. Also, it’s fast and simple to use without any dependencies.

    To quote the Simple project page:

    Simple is a high performance XML serialization and configuration framework for Java. Its goal is to provide an XML framework that enables rapid development of XML configuration and communication systems. This framework aids the development of XML systems with minimal effort and reduced errors. It offers full object serialization and deserialization, maintaining each reference encountered. In essence it is similar to C# XML serialization for the Java platform, but offers additional features for interception and manipulation.

提交回复
热议问题