001package org.kuali.ole.sys.batch; 002 003import java.util.List; 004 005/** 006 * Contract of methods for the configuration element which specifies how to parse a flat file 007 */ 008public interface FlatFileSpecification { 009 /** 010 * @return a List of the specifications for all objects which will be parsed into during the course of 011 * this flat file parse 012 */ 013 public List<FlatFileObjectSpecification> getObjectSpecifications(); 014 015 /** 016 * Retrieves the FlatFilePrefixObjectSpecification specifically associated with a given class 017 * @param businessObjectClass the class of a business object which will be parsed into 018 * @return the corresponding FlatFilePrefixObjectSpecification configuration object 019 */ 020 public FlatFileObjectSpecification getObjectSpecification(Class<?> businessObjectClass); 021 022 /** 023 * Determines the Class of the business object that the given line should be parsed into 024 * @param line the current line of the flat file parser being parsed 025 * @return the Class of the business object that the given line will be parsed into 026 */ 027 public Class<?> determineClassForLine(String line); 028 029 /** 030 * Parses the current line of the flat file into a business object 031 * @param parseSpecification the specification explaining how to parse the line into the business object 032 * @param lineToParse the current line being parsed 033 * @param parseIntoObject the target object to parse into 034 * @param lineNumber the current line number 035 */ 036 public void parseLineIntoObject( 037 FlatFileObjectSpecification parseSpecification, String lineToParse, 038 Object parseIntoObject, int lineNumber); 039}