Home > blog > EDI X12 Parsing in Java

EDI X12 Parsing in Java

We are happy to announce the latest release of our open source project Gozer. Gozer provides a library of EDI X12 parsers in Java for use by anyone in the EDI X12 Community. The focus is on the retail formats. Currently we support DEX 894 and have plans to support ASN 856 soon.

The combination of the new 0.1.2 and 0.1.4 releases adds the ability to perform a cyclic redundancy check on each of the transactions in the DEX 894 file. By default this capability is turned off, but can easily be turned on as shown in the example below:


String dexMessage = ...
DefaultDex894Parser dexParser = new DefaultDex894Parser();
DefaultDex894Validator dexValidator = new DefaultDex894Validator(); boolean performCrcCheck = true;
Dex894 dex = dexParser.parse(dexMessage);
Set<X12ErrorDetail> errorSet = dexValidator.validate(dex, performCrcCheck); 

The DefaultDex894Validator class is configured to use the DefaultCrc16 implementation of the CyclicRedundancyCheck interface. This implementation of the CRC-16 algorithm is the one defined in the DEX UCS Appendix B.

x^{16} + x^{15} + x^2 + 1

This version of the algorithm corresponds with the CRC-16/IBM implementation.

We would love to hear from users of Gozer and work with you on further improvements.

Mike