Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我目前正在开发一个通过平面文件获取数据的遗留应用程序。使用 beanio 读写平面文件,并通过注释定义记录。我的问题是,其中一个平面文件的规范要求使用索引 20 到 26(不是记录的结尾)的空白来为将来的目的预留空间。
我如何通过注释告诉 Beanio 在这些位置是必须忽略的空白?
您是否尝试定义@Field长度为 7 的 a 来消耗这些空间?
@Field
@Field(at = 20, length = 7, lazy = true, trim = true) private String spaces;
lazy=true和trim=true部分应该使该字段/属性始终null存在。
lazy=true
trim=true
null