|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.agimatec.utility.fileimport.ImporterProcessor
com.agimatec.utility.fileimport.LineImportProcessor
public class LineImportProcessor
Description: Import a file line-by-line, e.g. for csv-/comma-separated/fixed-column-length
files.
User: roman.stumm
Date: 22.11.2007
Time: 11:56:57
Copyright: Agimatec GmbH
| Field Summary | |
|---|---|
protected Object |
currentLine
|
protected Map |
currentRow
|
protected Object |
headerLine
|
protected LineReader |
lineReader
|
protected LineImporterSpec |
spec
|
| Fields inherited from class com.agimatec.utility.fileimport.ImporterProcessor |
|---|
cancelled, errorCount, importer, lastError, rowCount |
| Constructor Summary | |
|---|---|
LineImportProcessor(LineImporterSpec spec,
Importer importer)
|
|
| Method Summary | |
|---|---|
Object |
getCurrentLine()
the current row/line itself as it came from the LineReader |
Map |
getCurrentRow()
the current row/line itself as it was transferred to a map |
protected Object |
getHeaderLine()
|
LineReader |
getLineReader()
|
LineImporterSpec |
getSpec()
|
void |
importFrom(Closeable aReader)
API - this method starts the import process. |
protected void |
importRow(Object aLine)
import a record from the file and do what is required with the data. |
void |
release()
|
protected void |
setFieldValue(int fieldIdx,
Object singleValue)
|
protected Map |
transferRow(Object aRecord)
parse a specified record and save the record data in the root model. |
| Methods inherited from class com.agimatec.utility.fileimport.ImporterProcessor |
|---|
getErrorCount, getErrorWriter, getImporter, getLastError, getRowCount, handleException, handleRowException, isCancelled, log, logFinished, setCancelled, setErrorWriter, setLastError |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final LineImporterSpec spec
protected LineReader lineReader
protected Object headerLine
protected Object currentLine
protected Map currentRow
| Constructor Detail |
|---|
public LineImportProcessor(LineImporterSpec spec,
Importer importer)
| Method Detail |
|---|
public LineImporterSpec getSpec()
getSpec in class ImporterProcessor
public void importFrom(Closeable aReader)
throws ImporterException
importFrom in class ImporterProcessoraReader - - reader to read the import data from.
Exception
ImporterException
protected void importRow(Object aLine)
throws ImporterException
aLine - - a line of data of one record
ImporterExceptionpublic void release()
release in class ImporterProcessor
protected Map transferRow(Object aRecord)
throws IOException
IOException
protected void setFieldValue(int fieldIdx,
Object singleValue)
protected Object getHeaderLine()
public Map getCurrentRow()
public LineReader getLineReader()
public Object getCurrentLine()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||