Thread: [Batchserver-cvs] batchserver/src/org/jmonks/batchserver/io FileParseException.java, NONE, 1.1 File
Brought to you by:
suresh_pragada
From: Suresh <sur...@us...> - 2006-05-30 17:09:46
|
Update of /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/io In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv4983 Modified Files: FieldSpec.java FileSpec.java RecordSpec.java Added Files: FileParseException.java FileSpecException.java FixedWidthFlatFileFieldSpec.java FixedWidthFlatFileRecordSpec.java Removed Files: FixedWidthFieldSpec.java Log Message: no message --- NEW FILE: FileSpecException.java --- /* * FileSpecException.java * * Created on May 26, 2006, 11:36 PM * * To change this template, choose Tools | Options and locate the template under * the Source Creation and Management node. Right-click the template and choose * Open. You can then make changes to the template in the Source Editor. */ package org.jmonks.batchserver.io; /** * * @author Suresh Pragada * @version 1.0 * @since 1.0 */ public class FileSpecException extends RuntimeException { /** Creates a new instance of FileSpecException */ public FileSpecException() { } } --- NEW FILE: FileParseException.java --- /* * FileParseException.java * * Created on May 26, 2006, 11:42 PM * * To change this template, choose Tools | Options and locate the template under * the Source Creation and Management node. Right-click the template and choose * Open. You can then make changes to the template in the Source Editor. */ package org.jmonks.batchserver.io; /** * * @author Suresh Pragada */ public class FileParseException extends RuntimeException { /** Creates a new instance of FileParseException */ public FileParseException() { } } --- FixedWidthFieldSpec.java DELETED --- --- NEW FILE: FixedWidthFlatFileFieldSpec.java --- /* * FixedWidthFlatFileFieldSpec.java * * Created on May 26, 2006, 2:43 PM * * To change this template, choose Tools | Options and locate the template under * the Source Creation and Management node. Right-click the template and choose * Open. You can then make changes to the template in the Source Editor. */ package org.jmonks.batchserver.io; import org.w3c.dom.Element; /** * * @author Suresh Pragada */ public class FixedWidthFlatFileFieldSpec extends FieldSpec { private int startPosition=0; private int endPosition=0; /** * Creates a new instance of FixedWidthFlatFileFieldSpec */ protected FixedWidthFlatFileFieldSpec() { } public static FixedWidthFlatFileFieldSpec createFieldSpec(final Element fieldSpecElement) { return null; } } Index: RecordSpec.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/io/RecordSpec.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** RecordSpec.java 26 May 2006 22:22:26 -0000 1.1 --- RecordSpec.java 30 May 2006 17:09:43 -0000 1.2 *************** *** 13,16 **** --- 13,17 ---- import java.util.ArrayList; import java.util.List; + import org.w3c.dom.Element; /** *************** *** 25,29 **** /** Creates a new instance of RecordSpec */ ! public RecordSpec(RecordType recordType) { this.recordType=recordType; --- 26,30 ---- /** Creates a new instance of RecordSpec */ ! protected RecordSpec(RecordType recordType) { this.recordType=recordType; *************** *** 41,43 **** --- 42,58 ---- return fieldSpecList; } + + /** + * Constructs Record specification object from the given DOM Element + * representing the <record-spec> tag in file specification. + */ + public static RecordSpec createRecordSpec(final FileType fileType,final Element recordSpecElement) + { + if(fileType==FileType.FIXED_WIDTH_FLAT_FILE) + return FixedWidthFlatFileRecordSpec.createRecordSpec(fileType, recordSpecElement); + else if(fileType==FileType.DELIMITED_FLAT_FILE) + return null; //DelimitedFlatFileRecordSpec.createRecordSpec(fileType, recordSpecElement); + else + return null; + } } Index: FileSpec.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/io/FileSpec.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** FileSpec.java 26 May 2006 22:22:26 -0000 1.1 --- FileSpec.java 30 May 2006 17:09:43 -0000 1.2 *************** *** 13,20 **** import java.util.ArrayList; import java.util.List; /** * ! * @author Suresh Pragada */ public class FileSpec --- 13,23 ---- import java.util.ArrayList; import java.util.List; + import org.apache.log4j.Logger; /** * ! * @author Suresh Pragada ! * @version 1.0 ! * @since 1.0 */ public class FileSpec *************** *** 26,30 **** private List recordSpecList=null; ! /** Creates a new instance of FileSpec */ protected FileSpec() { --- 29,37 ---- private List recordSpecList=null; ! private static Logger logger=Logger.getLogger(FileSpec.class); ! ! /** ! * Creates a new instance of FileSpec ! */ protected FileSpec() { *************** *** 32,35 **** --- 39,49 ---- } + /** + * Adds the record spec object to the record spec list. + * + * @param recordSpec Record spec. + * + * @return Returns true, if record spec is added, false otherwise. + */ public boolean addRecordSpec(RecordSpec recordSpec) { *************** *** 37,46 **** return true; } ! public List getRecordSpec() { return this.recordSpecList; } ! public FileType getFileType() { --- 51,70 ---- return true; } ! ! /** ! * Gets the record spec's list. ! * ! * @return Returns record spec's list. ! */ public List getRecordSpec() { return this.recordSpecList; } ! ! /** ! * Gets the file type. ! * ! * @return Returns the file type. ! */ public FileType getFileType() { *************** *** 48,53 **** --- 72,82 ---- } + /** + * Constructs the file spcification object from the file represented by + * given the file specification path. + */ public static FileSpec createFileSpec(String fileSpecPath) { + FileSpec fileSpec=null; return null; } --- NEW FILE: FixedWidthFlatFileRecordSpec.java --- /* * FixedWidthFlatFileRecordSpec.java * * Created on May 26, 2006, 11:33 PM * * To change this template, choose Tools | Options and locate the template under * the Source Creation and Management node. Right-click the template and choose * Open. You can then make changes to the template in the Source Editor. */ package org.jmonks.batchserver.io; import org.w3c.dom.Element; /** * * @author Suresh Pragada */ public class FixedWidthFlatFileRecordSpec extends RecordSpec { /** Creates a new instance of FixedWidthFlatFileRecordSpec */ protected FixedWidthFlatFileRecordSpec() { } public static RecordSpec createFixedWidthFlatFileRecordSpec(final FileType fileType, final Element recordSpecElement) { return null; } } Index: FieldSpec.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/io/FieldSpec.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** FieldSpec.java 26 May 2006 22:22:26 -0000 1.1 --- FieldSpec.java 30 May 2006 17:09:43 -0000 1.2 *************** *** 11,14 **** --- 11,16 ---- package org.jmonks.batchserver.io; + import org.w3c.dom.Element; + /** * *************** *** 37,39 **** --- 39,46 ---- return this.fieldType; } + + public static FieldSpec createFieldSpec(final FileType fileType,final RecordType recordType,final Element fieldSpecElement) + { + return null; + } } |