Ancient Programming

What I encounter in my software part of life is in danger of being commented upon here

Archive for the 'fixedformat4j' Category

Fixedformat4j moves to github

Posted by Jacob von Eyben on 5th May 2015

After google has decided to close I have migrated the fixedformat4j sourcecode to github:

Posted in fixedformat4j, java | No Comments »

Fixedformat4j now supports primitive datatypes as well as innerclasses

Posted by Jacob von Eyben on 16th October 2008

Support for primitive datatypes is added to the latest 1.2.1 release of fixedformat4j. I would like to thank Marcos Lois Bermúdez for contributing with this extension. The latest release can be downloaded here.

The same 1.2.1 release also fixed the bug that made it impossible to use annotate and format static nested classes and inner classes

The complete changelist can be found on the project website.

In a few days the release should be available from ibiblio.

I encourage all users of fixedformat4j to contribute or create issues if they find a bug or would like new features to be added.

Posted in fixedformat4j, java | No Comments »

Fixedformat4j scores well on sonar

Posted by Jacob von Eyben on 5th June 2008

Today I found fixedformat4j was obtained at sonarsoftware and it was exciting to see that it scored pretty well compared to some other very well known opensource projects like the commons series, some of the spring module and even the Apache Maven project.

I didn’t know sonar before today. They describe them as:

Sonar is an entreprise quality control tool, distributed under the terms of the GNU LGPL. Its basic purpose is to join existing continuous integration tools to place Java development projects under quality control.

Even though the metrics at sonar doesn’t draw the complete picture on how good or mature a project is, it still gives a hint.

Posted in fixedformat4j, java | No Comments »

Fixedformat4j 1.1.1 released

Posted by Jacob von Eyben on 30th May 2008

We use fixedformat4j on my current project and I am developing fixedformat4j along the way. We have found the initial 1.0.0 release lacking in the ability to parse signed numbers like:

00011050+, that equals a two digit signed bigdecimal number 100.50

The fixedformatnumber annotation was introduced with the ability to add a signed attribute.

This is how you would annotate your method to be able to read and write a string like 000010050+:

@Field(offset = 1, length = 10, align = Align.RIGHT, paddingChar = '0')
@FixedFormatDecimal(useDecimalDelimiter = true)
@FixedFormatNumber(sign = Sign.APPEND)
public BigDecimal getBigDecimalData() {
  return bigDecimalData;

This was added in version 1.1.0, but some bugs was spotted and fixed so quickly a 1.1.1 version was released.

Feel free to download the latest version and take a look at the changelist.

Posted in fixedformat4j, java | No Comments »

Fixedformat4j released!

Posted by Jacob von Eyben on 25th May 2008

At my current project we decided to use fixedformat4j.
So after all your feedback on my recent draft implementation I have been working quite hard this weekend to get fixedformat4j shined up.

The implementation looks pretty much what Niels proposed here and I implemented support for bigdecimal as Bob wished. That means that javassist is gone and fixedformat4j is now much less intrusive - you don’t have ti extend or implement anything to be able to load and export data.

You can see just how easy on the “getting started” at the frontpage of the project.

At this time of writing the api is only available through the download page, but I have send a maven upload request so soon it will be available from ibiblio.

Posted in fixedformat4j, java | No Comments »

fixedformat4j api - bring on your feedback!

Posted by Jacob von Eyben on 17th March 2008

Earlier I wrote about reading and writing fixed formatted text files. Fortunately you all were eager to comment and provide suggestions on how to do this.
Inspired by your suggestions I decided to write an open source api to manipulate these fixed formatted data and promised to get back when I had code that was releasable.

That time is now!

I have deliberately not released a version yet as I would like some feedback before I commit myself to an api.

Please take a look at the documentation at and let me know your thoughts on the api.

The sourcecode can be browsed here.

I hope you will bring me some feedback before I do a final release.

Posted in fixedformat4j, java | 9 Comments »

Manipulating fixed formatted text files

Posted by Jacob von Eyben on 1st March 2008

I am working on a project where we need to manipulate fixed formatted text files. The fixed formatted files are used as protocol for interchanging data between some legacy mainframe systems. I have been looking for some already existing api for manipulating these fixed formatted data but couldn’t find any.

So this weekend I started implementing a solution based on some of the idea´s we got along the way.


I have a few goals for the api:

  1. A line of text should be easily manipulated as a java object.
  2. Should require a minimum of own code to manipulate the text string.
  3. Use annotations to define attributes like:
    • Offset in text
    • The fixed length of the text
    • padding direction and padding character

The api usage could look something like this:

public interface Record {

  // use if you need a reference to the manipulated string - could be a constructor
  void initialize(StringBuffer buffer);

  // use if you don't need a reference to the manipulated string - could be a constructor
  void initialize(String string);

  String export(); //export string
public abstract class MyRecord implements Record {

  @FixedFormatField(offset = 10, length=20, paddingChar='0')
  public abstract void setMyInteger(Integer myInteger);

  @FixedFormatField(offset = 10, length=20, paddingChar='0')
  public abstract Integer getMyInteger();

And then a factory to create instances of the Record. Maybe annotations on fields would be nice as well as dublicating annotations for setter/getter is waste and could be error-prone.

This is the part I am working on at the moment and getting some hands-on experience with javassist. I will get back to that in another post.


I have named the api fixedformat4j and I will opensource it as soon as I have something worth for others to use. Hopefully it won’t end up as one of my numerous 23% finished projects…

Posted in fixedformat4j, java | 6 Comments »