[Batchserver-cvs] batchserver/src/org/jmonks/batchserver/io/flat DelimitedFlatFileFieldSpec.java, 1
Brought to you by:
suresh_pragada
From: Suresh <sur...@us...> - 2006-06-22 22:52:06
|
Update of /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/io/flat In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv7914/flat Modified Files: DelimitedFlatFileFieldSpec.java DelimitedFlatFileFileSpec.java DelimitedFlatFileReader.java DelimitedFlatFileRecordSpec.java DelimitedFlatFileWriter.java FixedWidthFlatFileFieldSpec.java FixedWidthFlatFileWriter.java Log Message: no message Index: DelimitedFlatFileRecordSpec.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/io/flat/DelimitedFlatFileRecordSpec.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** DelimitedFlatFileRecordSpec.java 15 Jun 2006 18:57:02 -0000 1.3 --- DelimitedFlatFileRecordSpec.java 22 Jun 2006 22:52:01 -0000 1.4 *************** *** 27,31 **** * Attribute <code>delimiter</code> tells the value that divides or delimits the fields * and attribute <code>field-count</code> tells the number of fields exists in the record. ! * There should be only one record spec is allwed in the file spec. * Here is a sample spec snippet... * </p> --- 27,31 ---- * Attribute <code>delimiter</code> tells the value that divides or delimits the fields * and attribute <code>field-count</code> tells the number of fields exists in the record. ! * There should be only one record spec is allowed in this file spec. * Here is a sample spec snippet... * </p> *************** *** 117,122 **** String delimiter=recordSpecElement.getAttribute(DelimitedFlatFileRecordSpec.DELIMITER_ATTRIB_NAME); logger.debug("record specs delimiter value = " + delimiter); ! if(delimiter!=null && !"".equals(delimiter.trim())) ! recordSpec.delimiter=delimiter.trim(); else throw new FileSpecException("Record Spec in Delimited File Spec should have delimiter attribute."); --- 117,122 ---- String delimiter=recordSpecElement.getAttribute(DelimitedFlatFileRecordSpec.DELIMITER_ATTRIB_NAME); logger.debug("record specs delimiter value = " + delimiter); ! if(delimiter!=null && !"".equals(delimiter)) ! recordSpec.delimiter=delimiter; else throw new FileSpecException("Record Spec in Delimited File Spec should have delimiter attribute."); Index: DelimitedFlatFileWriter.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/io/flat/DelimitedFlatFileWriter.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** DelimitedFlatFileWriter.java 21 Jun 2006 22:02:29 -0000 1.5 --- DelimitedFlatFileWriter.java 22 Jun 2006 22:52:01 -0000 1.6 *************** *** 21,25 **** /** * <p> ! * DelimitedFlatFileWriter writes/generates the file according to the given file spec * with the data submitted in the form of WriterRecord's. This provides the methods * to create the required writer records and write the writer record into the file writer. --- 21,25 ---- /** * <p> ! * DelimitedFlatFileWriter writes the file according to the given file spec * with the data submitted in the form of WriterRecord's. This provides the methods * to create the required writer records and write the writer record into the file writer. *************** *** 44,48 **** * and file spec. * ! * @param fileOutputStream Output stream representing the file to generate. * @param fileSpec File spec of the delimited flat to be generated. */ --- 44,48 ---- * and file spec. * ! * @param outputStream Output stream representing the file to generate. * @param fileSpec File spec of the delimited flat to be generated. */ Index: DelimitedFlatFileReader.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/io/flat/DelimitedFlatFileReader.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** DelimitedFlatFileReader.java 21 Jun 2006 22:02:29 -0000 1.6 --- DelimitedFlatFileReader.java 22 Jun 2006 22:52:01 -0000 1.7 *************** *** 25,29 **** * DelimitedFlatFileReader reads the specified delimited flat file according to the given file spec * and returns the recrods on the needed basis. Each field value from the record ! * should be read using readField method by passing the fieldName mentioned in * the file spec. To find out how to read each record from the file and to read * the each field from the record, refer to the FileReader javadoc. --- 25,29 ---- * DelimitedFlatFileReader reads the specified delimited flat file according to the given file spec * and returns the recrods on the needed basis. Each field value from the record ! * should be read using <code>readField</code> method by passing the fieldName mentioned in * the file spec. To find out how to read each record from the file and to read * the each field from the record, refer to the FileReader javadoc. *************** *** 80,84 **** String[] fieldValuesArray=recordString.split(recordSpec.getDelimiter()); if(fieldValuesArray.length!=recordSpec.getFieldCount()) ! throw new FileParseException("Record " + recordString + " doesnt have " + recordSpec.getFieldCount() + " of fields."); List fieldSpecList=recordSpec.getFieldSpecs(); --- 80,84 ---- String[] fieldValuesArray=recordString.split(recordSpec.getDelimiter()); if(fieldValuesArray.length!=recordSpec.getFieldCount()) ! throw new FileParseException("Record " + recordString + " doesnt have " + recordSpec.getFieldCount() + " fields."); List fieldSpecList=recordSpec.getFieldSpecs(); Index: FixedWidthFlatFileFieldSpec.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/io/flat/FixedWidthFlatFileFieldSpec.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** FixedWidthFlatFileFieldSpec.java 21 Jun 2006 22:02:29 -0000 1.5 --- FixedWidthFlatFileFieldSpec.java 22 Jun 2006 22:52:01 -0000 1.6 *************** *** 17,25 **** /** * <p> ! * FixedWidthFlatFileFieldSpec represents field-spec element in the record spec ! * belongs to the fixed width flat file type. Along with the field-name attribute ! * it looks for the start-pos and end-pos attributes in the field-spec element to retrieve ! * the field from the record. Filed name on field-spec should be unique across the record-spec. ! * Position value starts with "1" and the start-pos and end-pos values are inclusive. * Here is a sample spec snippet... * </p> --- 17,25 ---- /** * <p> ! * FixedWidthFlatFileFieldSpec represents <code>field-spec</code> element in the record spec ! * belongs to the fixed width flat file type. Along with the <code>field-name</code> attribute ! * it looks for the <code>start-pos</code> and <code>end-pos</code> attributes in the field-spec element to retrieve ! * the field from the record. Field name on <code>field-spec</code> should be unique across the record-spec. ! * Position value starts with "1" in the record and the start-pos and end-pos values are inclusive. * Here is a sample spec snippet... * </p> Index: FixedWidthFlatFileWriter.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/io/flat/FixedWidthFlatFileWriter.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** FixedWidthFlatFileWriter.java 21 Jun 2006 22:02:29 -0000 1.10 --- FixedWidthFlatFileWriter.java 22 Jun 2006 22:52:01 -0000 1.11 *************** *** 23,27 **** /** * <p> ! * FixedWidthFlatFileWriter writes/generates the file according to the given file spec * with the data submitted in the form of WriterRecord's. This provides the methods * to create the required writer records and write the writer record into the file writer. --- 23,27 ---- /** * <p> ! * FixedWidthFlatFileWriter writes the file according to the given file spec * with the data submitted in the form of WriterRecord's. This provides the methods * to create the required writer records and write the writer record into the file writer. Index: DelimitedFlatFileFieldSpec.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/io/flat/DelimitedFlatFileFieldSpec.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** DelimitedFlatFileFieldSpec.java 10 Jun 2006 17:51:37 -0000 1.1 --- DelimitedFlatFileFieldSpec.java 22 Jun 2006 22:52:01 -0000 1.2 *************** *** 18,23 **** /** * <p> ! * DelimitedFlatFileFieldSpec represents field-spec element in the record spec ! * belongs to the delimited flat file type. Along with the field-name attribute * it looks for the <code>index</code> attribute in the field-spec element to retrieve * the field from the record. It specifies the field position in the record. --- 18,23 ---- /** * <p> ! * DelimitedFlatFileFieldSpec represents <code>field-spec</code> element in the <code>record spec</code> ! * element belongs to the delimited flat file type. Along with the <code>field-name</code> attribute * it looks for the <code>index</code> attribute in the field-spec element to retrieve * the field from the record. It specifies the field position in the record. Index: DelimitedFlatFileFileSpec.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/io/flat/DelimitedFlatFileFileSpec.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** DelimitedFlatFileFileSpec.java 12 Jun 2006 13:15:37 -0000 1.2 --- DelimitedFlatFileFileSpec.java 22 Jun 2006 22:52:01 -0000 1.3 *************** *** 24,28 **** * DelimitedFlatFileFileSpec represents the file spec defines the flat file * where all the fields in the records delimited with a particular character or value. ! * This file-spec doesn't require any special attributes other than file-type, * which should be "delimited-flat". * Here is a sample file spec... --- 24,28 ---- * DelimitedFlatFileFileSpec represents the file spec defines the flat file * where all the fields in the records delimited with a particular character or value. ! * This file spec doesn't require any special attributes other than <code>file-type</code> attribute, * which should be "delimited-flat". * Here is a sample file spec... |