将XML转换为对象的最佳方式 [英] Optimal way to convert XML to Objects

查看:156
本文介绍了将XML转换为对象的最佳方式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Java在Google App Engine上创建一个应用程序,该应用程序接受一个标准的XML文件并将其映射到一个对象 - 然后将其保存到数据存储区。

I'm creating an app on Google App Engine using Java, which accepts a standard XML file and maps it to an object- which is then saved to the datastore.

我期望每天有大量的条目(大约500+)..考虑到CPU和数据配额的成本,序列化xml的最佳方式是什么GAE / j?

I'm expecting quite a bit of entries/day (about 500+).. What is the optimal way of serializing xml, considering the cost in CPU and Data quotas of GAE/j?

推荐答案

如果您的优化视图是序列化/解串的最简单的方法 (在这种情况下,我建议这是),然后看看 XStream ,它可以将POJO转换为/从XML没有任何注释/接口要求等。

If your view of optimal is the simplest way of serialising/deserialising (and in this instance I suggest it is), then take a look at XStream, which can convert POJOs to/from XML without any annotations/interface requirements etc.

这篇关于将XML转换为对象的最佳方式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆