SourceForge.net Logo

Support This Project

txt2j

txt2j is a simple tool for text (fixed-width records) to java objects mapping/binding. Mapping is defined using xml document or Excel worksheet. txt2j generates high performance runtime code.

txt2j is designed to be used in high performance production environment. Runtime code does not use performance cost APIs like java reflection or intermediate text-to-xml transformation, only StringBuffer and IO streams. (Reflection versus code generation - see http://www.javaworld.com/javaworld/jw-11-2001/jw-1102-codegen.html ).

Its primary audience is developers working with financial, insurance, healthcare legacy applications.

Mapping/binding is declarative and easy to use - to create and to maintain. It can serve as a format definition, documentation and runtime code definition!

It is possible to mix mapping/binding - text fields are mapped to the attributes of existing java classes, new ones are generated by the tool. Developer specifies mapping in Microsoft Excel worksheet. Very often message formats are specified using Word/Excel documents - a developer just copies this description in Excel worksheet and adds java class field names in the next column. That's it! Excel VBA-macros transforms this mapping in xml document which is used to generate runtime code with Velocity (http://jakarta.apache.org/velocity/) and XMLBeans (http://xmlbeans.apache.org/).

The tool is designed to be flexible and easy to use and to extend. A developer can modify Velocity templates for his specific tasks. He can also enrich the existing collection of predefined types (numeric, alphanumeric, date, boolean). For example, he can add a type "numeric field mapped to java.math.BigDecimal, null values are allowed". VBA-macros is simple and well documented and Excel worksheet/macros can be modified even by a java developer for his specific project needs.

.NET runtime code generation will be added later.

Actually I'm working on project documentation. The first version will be available soon. You can contact me by mail at: mihhon@gmail.com

Copyright 2005 Mikhail Kotliar