Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 10 years ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(6)
快速更新:扁虫已经有一段时间没有活跃了,有一个名为 BeanIO 的分支:
http://www.beanio.org/
Quick update: flatworm has not been active for quite a while, there is a fork named BeanIO:
http://www.beanio.org/
FFP - 平面文件解析库
http://jffp.sourceforge.net/
FFP - Flat file parsing library
http://jffp.sourceforge.net/
我编写的使用 Java 注释的另一种选择是 JFileHelpers - http://jfilehelpers.com
带注释的 bean 示例:
那么你所要做的就是:
Another alternative, that I wrote that uses Java Annotations is JFileHelpers - http://jfilehelpers.com
An example of annotated bean:
Then all you have to do is:
我没有使用过这个JFlat,但似乎这个框架提供从平面文件到 Java 对象的转换。
类似地 BeanIO 和 Jsefa还提供了简单灵活的API。
您可以尝试使用 FlatPack - 但它很旧,而且文档不如 JFlat 或 BeanIO
Apache Camel 有 Flatpack 组件,从 2.10 开始它有 BeanIO 组件
I have not used this JFlat, But it seems this Framework provides conversion from Flat file to Java object.
Similarly BeanIO and Jsefa also provides a simple and flexible API.
You can try with FlatPack - but it is OLD and the docs are not good as JFlat or BeanIO
Apache Camel has Flatpack component as well as from 2.10 it has BeanIO component
您想考虑JRecordBind(我是它的作者)
与其他人不同,它能够解析和创建平面文件,并且它使用纯 XML 模式(因此您不必学习其他配置语法)。
一些用户回收相同的 XSD 来生成 Web 服务和平面文件输出。
ps:我最近将代码移至 github
You would like to consider JRecordBind (I'm its author)
Unlike others, it's able to both parse and create flat files and it uses plain XML Schema (so you don't have to learn yet another configuration syntax).
Some users recycle the same XSD for producing both webservice and flat files output.
ps: I've recently moved the code to github
您还可以尝试 Fixedformat4j。
我喜欢注释方法,并且定义自定义字段格式非常简单。
You can also give a try to Fixedformat4j.
I like the annotations approach and it's very simple to define a custom field format.