JRecord

The JRecord is for reading

  1. Binary Files
  2. Fixed field width files
  3. CSV (Delimited) files
  4. XML (via a StAX parser).
  5. Supports non-standard file Structures (i.e. Mainframe VB and Fixed Length).

JRecord also provides great flexibility in

Important packages in JRecord:

Following is an example of reading & writing a file using a RecordEditor-XML record-layout

           LayoutDetail layout = CopybookLoaderFactory.getInstance().getLayoutRecordEditXml(copybookName, null);
	            
           int fileStructure = layout.getFileStructure();
	            
           AbstractLineReader reader  = LineIOProvider.getInstance().getLineReader(fileStructure);
           AbstractLineWriter writer  = LineIOProvider.getInstance().getLineWriter(fileStructure);
	            
           reader.open(salesFile, layout);
           writer.open(salesFileOut);

           while ((saleRecord = reader.read()) != null) {
               AbstractFieldValue salePrice = saleRecord.getFieldValue("SALE-PRICE");
               
               salePrice.set(salePrice.asDouble() / GST_CONVERSION);
               writer.write(saleRecord);
           }

           reader.close();
           writer.close();

RecordEditor Interface

The following classes are used by the RecordEditor as interfaces to JRecord. You can extend the RecordEditor by changing the appropriate interface class.