public abstract class ImportStd extends InterruptibleProcess
ExportStd
Modifier and Type | Class and Description |
---|---|
class |
ImportStd.NoDataFoundException |
Modifier and Type | Field and Description |
---|---|
protected java.lang.String[] |
colHeaders |
protected java.lang.String[] |
colNames |
protected int[] |
colTypes |
protected boolean |
exists |
protected DataTextObjectWithDelimiter |
inp |
protected DataObject |
mainDataObject |
sessionResources
Constructor and Description |
---|
ImportStd(AliveConfirmer aliveConfirmer) |
Modifier and Type | Method and Description |
---|---|
protected <DoByDesc extends DataObject & LoadableByDescription> |
addDescDo(DoByDesc descDo)
Adds a DataObject implementing LoadableByDescription to delegate import to a table reference.
|
protected <DoByDesc extends DataObject & LoadableByDescription> |
addDescDo(java.lang.String desc,
DoByDesc descDo)
Adds a DataObject implementing LoadableByDescription to delegate import to a table reference.
|
protected void |
addRefDo(java.lang.String keyColumn,
DataObject refDo)
Adds a reference DataObject with single string identifier associated with the column.
|
protected void |
beforeSaving() |
int |
getImportAmount() |
void |
importFromTextFile(java.lang.String filePath) |
protected boolean |
load()
Returns true if a database record exists which matches the row to import.
|
protected void |
processImport() |
protected void |
setDataTextObjectWithDelimiter(DataTextObjectWithDelimiter inp)
Sets the file containing the rows to be imported.
|
protected void |
setInitialValues() |
protected void |
setMainDataObject(DataObject mainDataObject)
Set the main DataObject receiving the imported rows.
|
void |
setMandatoryHeaders(java.lang.String[] mandatoryHeaders)
Sets mandatory headers - if they are not found, NoDataException is thrown.
|
getConflictInfos, hasConflict, isToRun, setAliveConfirmer, setConflictInfo, setConflictInfo, setStatusInfoPresenter, setStatusInformation
protected DataObject mainDataObject
protected DataTextObjectWithDelimiter inp
protected java.lang.String[] colHeaders
protected java.lang.String[] colNames
protected int[] colTypes
protected boolean exists
public ImportStd(AliveConfirmer aliveConfirmer)
public void setMandatoryHeaders(java.lang.String[] mandatoryHeaders)
mandatoryHeaders
- the headers that must exist in first rowprotected void setDataTextObjectWithDelimiter(DataTextObjectWithDelimiter inp)
inp
- the file containing the rows to be importedprotected void setMainDataObject(DataObject mainDataObject)
mainDataObject
- main DataObject receiving the imported rowsprotected <DoByDesc extends DataObject & LoadableByDescription> void addDescDo(DoByDesc descDo)
descDo
- DataObject implementing LoadableByDescriptionprotected <DoByDesc extends DataObject & LoadableByDescription> void addDescDo(java.lang.String desc, DoByDesc descDo)
desc
- the description of the columndescDo
- DataObject implementing LoadableByDescriptionprotected void addRefDo(java.lang.String keyColumn, DataObject refDo)
keyColumn
- the key column namerefDo
- the reference data objectpublic void importFromTextFile(java.lang.String filePath) throws ImportStd.NoDataFoundException
ImportStd.NoDataFoundException
protected void processImport() throws ImportStd.NoDataFoundException
ImportStd.NoDataFoundException
protected void setInitialValues()
protected void beforeSaving()
protected boolean load()
public int getImportAmount()
Copyright 1998-2023 Christoph Mueller, Kaerntner Str. 56, D-70469 Stuttgart, Germany, https://www.perpus.de