Class CsvImportTask<CsvType>
- java.lang.Object
-
- javax.swing.SwingWorker<T,V>
-
- com.openindex.openestate.tool.ImmoToolTask<Long,Void>
-
- com.openindex.openestate.tool.utils.CsvImportTask<CsvType>
-
- Type Parameters:
CsvType
- Klasse des CSV-Zielobjektes
- All Implemented Interfaces:
PropertyChangeListener
,Runnable
,Future<Long>
,RunnableFuture<Long>
,EventListener
- Direct Known Subclasses:
ContactsEntryImportCsvTask
public abstract class CsvImportTask<CsvType> extends ImmoToolTask<Long,Void>
AllgemeinerImmoToolTask
zum Import von CSV-Tabellen.- Author:
- Andreas Rudolph
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.openindex.openestate.tool.ImmoToolTask
ImmoToolTask.Adapter, ImmoToolTask.Callback, ImmoToolTask.Listener
-
Nested classes/interfaces inherited from class javax.swing.SwingWorker
SwingWorker.StateValue
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
CsvImportTask(File csvFile)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract CsvType
createCsvObject()
ComboBoxModel<Integer>
createFieldModel()
protected Long
doInBackground()
protected Long
executeImport()
File
getCsvFile()
protected abstract int
getDefinedFieldCount()
Map<Integer,List<Integer>>
getFieldMapping()
protected abstract String
getFieldTitle(int index)
protected String
getValue(org.apache.commons.csv.CSVRecord record, int field)
boolean
isMultipleSelectionAllowed(int field)
protected abstract void
readRecord(org.apache.commons.csv.CSVRecord record, CsvType dest)
protected abstract boolean
saveCsvObject(CsvType container, long lineNr)
void
setupReader(org.apache.commons.csv.CSVFormat format)
void
setupReader(org.apache.commons.csv.CSVFormat format, Charset charset)
void
setupReader(org.apache.commons.csv.CSVFormat format, Charset charset, boolean ignoreFirstLine)
-
Methods inherited from class com.openindex.openestate.tool.ImmoToolTask
addListener, cancelled, checkCancelled, createCallback, done, executeAndWait, executeAndWait, failed, finished, getDescription, getId, getMessage, getParentWindow, getTaskDialog, getTitle, isCancelException, isPending, isStarted, process, propertyChange, removeListener, setDescription, setMessage, setParentWindow, setProgress, setProgress, setProgress, setProgress, setTaskDialog, setTitle, succeeded
-
Methods inherited from class javax.swing.SwingWorker
addPropertyChangeListener, cancel, execute, firePropertyChange, get, get, getProgress, getPropertyChangeSupport, getState, isCancelled, isDone, publish, removePropertyChangeListener, run, setProgress
-
-
-
-
Constructor Detail
-
CsvImportTask
protected CsvImportTask(File csvFile)
-
-
Method Detail
-
createCsvObject
protected abstract CsvType createCsvObject()
-
createFieldModel
public ComboBoxModel<Integer> createFieldModel()
-
doInBackground
protected Long doInBackground() throws Exception
- Specified by:
doInBackground
in classImmoToolTask<Long,Void>
- Throws:
Exception
-
executeImport
protected Long executeImport() throws IOException
- Throws:
IOException
-
getDefinedFieldCount
protected abstract int getDefinedFieldCount()
-
getCsvFile
public File getCsvFile()
-
getFieldTitle
protected abstract String getFieldTitle(int index)
-
getValue
protected String getValue(org.apache.commons.csv.CSVRecord record, int field)
-
isMultipleSelectionAllowed
public boolean isMultipleSelectionAllowed(int field)
-
readRecord
protected abstract void readRecord(org.apache.commons.csv.CSVRecord record, CsvType dest)
-
saveCsvObject
protected abstract boolean saveCsvObject(CsvType container, long lineNr)
-
setupReader
public final void setupReader(org.apache.commons.csv.CSVFormat format)
-
setupReader
public final void setupReader(org.apache.commons.csv.CSVFormat format, Charset charset)
-
setupReader
public void setupReader(org.apache.commons.csv.CSVFormat format, Charset charset, boolean ignoreFirstLine)
-
-