[Batchserver-cvs] batchserver/src/org/jmonks/batchserver/io package.html, 1.5, 1.6
Brought to you by:
suresh_pragada
From: Suresh <sur...@us...> - 2006-06-15 03:35:55
|
Update of /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/io In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv715 Modified Files: package.html Log Message: no message Index: package.html =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/io/package.html,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** package.html 14 Jun 2006 21:01:38 -0000 1.5 --- package.html 15 Jun 2006 03:35:52 -0000 1.6 *************** *** 9,21 **** This package provides the API for the client programs to work with the files easily irrespective of the file format. This API is based on the analogy that all the ! files to be read and write have some data in the form of records and each ! record consists of a set of fields. Structure of these files, records and fields can be defined or configured using xml format. API allows the client programs ! to reads the records in an iterative manner from the file by specifying the xml file ! defined the file structure (It will be called as file spec here onwards) ! and file to read. API allows the client programs to create the record and write that record into the file. </p> ! <p> <h3>Defining file structure</h3> --- 9,21 ---- This package provides the API for the client programs to work with the files easily irrespective of the file format. This API is based on the analogy that all the ! files to be read and write have some data in the form of records and each ! record consists of a set of fields. Structure of these files, records and fields can be defined or configured using xml format. API allows the client programs ! to reads the records in an iterative manner from the file by specifying the xml file ! defined the file structure (It will be called as file spec here onwards) ! and file to read. API allows the client programs to create the record and write that record into the file. </p> ! <p> <h3>Defining file structure</h3> *************** *** 23,31 **** and each record consists of multiple fields. Structure of the file will be defined using the root tag <file-spec> accepts the attribute ! <code>file-type</code> which signifies the kind of format of the file it is defining. Allowed values for the <code>file-type</code> attribute should be from FileType ! class. This class defines all the available file types can be used. Using the value doesnt exist in the FileType class results FileSpecException being thrown. ! Implementations may expects other attributes along with the <code>file-type</code> attribute for better file reading and file writing. These additional attributes will be mentioned by the FileSpec impelementors. --- 23,31 ---- and each record consists of multiple fields. Structure of the file will be defined using the root tag <file-spec> accepts the attribute ! <code>file-type</code> which signifies the kind of format of the file it is defining. Allowed values for the <code>file-type</code> attribute should be from FileType ! class. This class defines all the available file types can be used. Using the value doesnt exist in the FileType class results FileSpecException being thrown. ! Implementations may expects other attributes along with the <code>file-type</code> attribute for better file reading and file writing. These additional attributes will be mentioned by the FileSpec impelementors. *************** *** 36,49 **** </pre> </p> ! <p> As every file will have its data in the form of records, each record will be defined using the tag <record-spec> in the <file-spec> tag. Every <code>record-spec</code> ! will have a <code>record-type</code> attribute which signifies the kind of record it is configuring ! like header record or detail record or trailer record. This <code>record-type</code> should be unique across the file spec and the value can be taken from RecordType class. Allowed to use other record types not defined in the RecordType class. ! Along with the <code>record-type</code> attribute each implementation will require ! additional attributes to idnetify the records in the file and to write the records into the file. These additional attributes will be mentioned by the RecordSpec implementations. <pre> --- 36,49 ---- </pre> </p> ! <p> As every file will have its data in the form of records, each record will be defined using the tag <record-spec> in the <file-spec> tag. Every <code>record-spec</code> ! will have a <code>record-type</code> attribute which signifies the kind of record it is configuring ! like header record or detail record or trailer record. This <code>record-type</code> should be unique across the file spec and the value can be taken from RecordType class. Allowed to use other record types not defined in the RecordType class. ! Along with the <code>record-type</code> attribute each implementation will require ! additional attributes to idnetify the records in the file and to write the records into the file. These additional attributes will be mentioned by the RecordSpec implementations. <pre> *************** *** 53,62 **** </record-spec> </file-spec> ! </pre> </p> ! <p> As every record spec consists of set of fields, each field is defined using the tag <field-spec> ! in <record-spec> tag. Each <code>field-spec</code> should have an attribute </code>field-name</code> identifies the name of the field, which will be used to populate the field values into the record. Based on the implementation, additional attributes will be required along with the <code>field-name</code> to identify --- 53,62 ---- </record-spec> </file-spec> ! </pre> </p> ! <p> As every record spec consists of set of fields, each field is defined using the tag <field-spec> ! in <record-spec> tag. Each <code>field-spec</code> should have an attribute </code>field-name</code> identifies the name of the field, which will be used to populate the field values into the record. Based on the implementation, additional attributes will be required along with the <code>field-name</code> to identify *************** *** 69,80 **** </record-spec> </file-spec> ! </pre> </p> ! <p> <h3>Reading records from the file</h3> ! FileReader class helps us in obtaining the FileReader instance through various factory methods ! by accepting the file to be read and file spec in different forms. FileReader reads ! data from the file according to the given file spec and when it finds a match to any of the provided record spec, it reads that record and returns field values as ReaderRecord instance. ReaderRecord instance has a method to read the field values by passing the field names. --- 69,80 ---- </record-spec> </file-spec> ! </pre> </p> ! <p> <h3>Reading records from the file</h3> ! FileReader class helps us in obtaining the FileReader instance through various factory methods ! by accepting the file to be read and file spec in different forms. FileReader reads ! data from the file according to the given file spec and when it finds a match to any of the provided record spec, it reads that record and returns field values as ReaderRecord instance. ReaderRecord instance has a method to read the field values by passing the field names. *************** *** 98,102 **** if(record.getRecordType().equals(RecordType.DETAIL)) { ! String fieldValue1=readerRecord.readField("field-name1"); // Read the rest of the field and does the processing. } --- 98,102 ---- if(record.getRecordType().equals(RecordType.DETAIL)) { ! String fieldValue1=record.readField("field-name1"); // Read the rest of the field and does the processing. } *************** *** 106,113 **** </pre> </p> ! <p> <h3>Writing records into the file</h3> ! FileWriter class helps us in obtaining the FileWriter instance through various factory methods by accepting the file to be written and file spec in different forms. FileWriter accepts WriterRecord instances which actually consists of the field values to write the data --- 106,113 ---- </pre> </p> ! <p> <h3>Writing records into the file</h3> ! FileWriter class helps us in obtaining the FileWriter instance through various factory methods by accepting the file to be written and file spec in different forms. FileWriter accepts WriterRecord instances which actually consists of the field values to write the data *************** *** 135,139 **** </i> </pre> ! </p> </body> </html> --- 135,139 ---- </i> </pre> ! </p> </body> </html> |