问题描述
我需要决定使用哪一个。我的情况非常简单。我需要将一个简单的POJO / Bean转换为XML,然后再转换回来。没什么特别的。
I need to decide on which one to use. My case is pretty simple. I need to convert a simple POJO/Bean to XML, and then back. Nothing special.
我要找的一件事是它应该包括父属性。最好是它可以在超类型上工作,它可以只是一个标记界面。
One thing I am looking for is it should include the parent properties as well. Best would be if it can work on super type, which can be just a marker interface.
如果有人可以将这两者与缺点和专业人士进行比较,哪些东西丢失了在哪一个。我知道也支持JSON,这是一个优点。但是,如果我们将JSON放在一边,看起来就更简单了。在开发和社区方面,Simple的未来是什么? XStream非常受欢迎我相信,即使是XStream这个词,在SO上打了很多线程。
If anyone can compare these two with cons and pros, and which thing is missing in which one. I know that XStream supports JSON too, thats a plus. But Simple looked simpler in a glance, if we set JSON aside. Whats the future of Simple in terms of development and community? XStream is quite popular I believe, even the word, "XStream", hit many threads on SO.
谢谢。
推荐答案
为什么不使用JAXB?
Why not use JAXB instead?
- 100%架构覆盖率
- 庞大的用户群
- 多个实现(如果您遇到一个错误)
- 包含在Java SE 6中,兼容使用JDK 1.5
- JAX-WS的绑定层(Web服务)
- JAX-RS的绑定层(其余)
- 与JSON兼容(与Jettison等库一起使用时)
- 100% schema coverage
- Huge user base
- Multiple implementations (in case you hit a bug in one)
- Included in Java SE 6, compatible with JDK 1.5
- Binding layer for JAX-WS (Web Services)
- Binding layer for JAX-RS (Rest)
- Compatible with JSON (when used with libraries such as Jettison)
有用的资源:
- Comparison, JAXB & XStream
- Comparison, JAXB & Simple
这篇关于XStream或Simple的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!