com.agimatec.utility.fileimport
Class LineImporterSpec

java.lang.Object
  extended by com.agimatec.utility.fileimport.LineImporterSpec
All Implemented Interfaces:
ImporterSpec
Direct Known Subclasses:
LineImporterSpecAutoFields

public class LineImporterSpec
extends Object
implements ImporterSpec

Description: Not thread-safe! Specify the behavior of an Importer
User: roman.stumm
Date: 28.08.2007
Time: 16:42:15
Copyright: Agimatec GmbH


Nested Class Summary
static class LineImporterSpec.Header
           
 
Field Summary
protected static org.apache.log4j.Logger log
           
 
Constructor Summary
LineImporterSpec()
           
 
Method Summary
 LineReader createLineReader(Closeable aReader)
          initialize the lineReader. overwrite in subclasses if required
 ImporterProcessor createProcessor(Importer importer)
          factory method - create a processor capable to process the data to be imported.
 Writer getErrorWriter()
          convience method -
 String getFieldName(int fieldIdx)
           
 String[] getFieldNames()
           
 int getHeaderLineIndex()
           
 LineImporterSpec.Header getHeaderSpec()
           
 LineTokenizerFactory getLineTokenizerFactory()
           
 void processHeaderLine(LineImportProcessor processor)
          overwrite this method to get the behavior after the header line has been read
 void processRow(LineImportProcessor processor)
          overwrite this method to get the behavior after a row has been completly transfered.
 void setErrorWriter(Writer errorWriter)
           
 void setFieldNames(String[] fieldNames)
           
 void setHeaderLineIndex(int index)
           
 void setHeaderSpec(LineImporterSpec.Header headerSpec)
           
 void setLineTokenizerFactory(LineTokenizerFactory lineTokenizerFactory)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected static final org.apache.log4j.Logger log
Constructor Detail

LineImporterSpec

public LineImporterSpec()
Method Detail

getLineTokenizerFactory

public LineTokenizerFactory getLineTokenizerFactory()

setLineTokenizerFactory

public void setLineTokenizerFactory(LineTokenizerFactory lineTokenizerFactory)

getHeaderSpec

public LineImporterSpec.Header getHeaderSpec()

setHeaderSpec

public void setHeaderSpec(LineImporterSpec.Header headerSpec)

getFieldNames

public String[] getFieldNames()

setFieldNames

public void setFieldNames(String[] fieldNames)
Parameters:
fieldNames - - array with the fieldNames or null

setErrorWriter

public void setErrorWriter(Writer errorWriter)

getErrorWriter

public Writer getErrorWriter()
Description copied from interface: ImporterSpec
convience method -

Specified by:
getErrorWriter in interface ImporterSpec
Returns:
null or the writer to write errors to

createProcessor

public ImporterProcessor createProcessor(Importer importer)
Description copied from interface: ImporterSpec
factory method - create a processor capable to process the data to be imported.

Specified by:
createProcessor in interface ImporterSpec
Returns:

getFieldName

public String getFieldName(int fieldIdx)

processRow

public void processRow(LineImportProcessor processor)
                throws ImporterException
overwrite this method to get the behavior after a row has been completly transfered.

Throws:
ImporterException

processHeaderLine

public void processHeaderLine(LineImportProcessor processor)
                       throws ImporterException
overwrite this method to get the behavior after the header line has been read

Throws:
ImporterException

setHeaderLineIndex

public void setHeaderLineIndex(int index)

getHeaderLineIndex

public int getHeaderLineIndex()

createLineReader

public LineReader createLineReader(Closeable aReader)
                            throws IOException
initialize the lineReader. overwrite in subclasses if required

Throws:
Exception
IOException


Copyright © 2008-2011. All Rights Reserved.