Reputation: 525
I'm trying to create a file mapper right now, but stumbling a bit over the best way to represent the various constituent parts of the file to be created.
Essentially, each file is made up of different types of segments. In turn, each segment is made up of a few different types of fields. Each segment is uniquely composed of different types of fields. So for example, you might have a name segment that is made up of an alphanumeric field, an integer field, and a boolean field. Since each segment is uniquely defined by the order and types of it fields, I would like to have a different class for each segment, as segments can come up multiple times in the same file.
What is the best way of representing in each segment what fields are contained within? Right now I'm hardcoding them in a list, but there must be a better way.
Upvotes: 0
Views: 112
Reputation: 308763
Sounds like EDI to me:
Is there any good open source EDIFACT parser in Java?
I wonder if you might find that helpful.
Upvotes: 1