Package cdc.impex.imports
Interface ImportRow
-
public interface ImportRowDefinition of an import row.- Author:
- Damien Carbonne
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description booleancanBeProcessed()ImportActiongetAction()default <T> TgetData(ColumnTemplate<T> column, T def)Returns the data associated to a column or a default value.default <T> TgetData(Class<T> cls, String name, T def)Returns the data associated to a column or a default value.default ObjectgetData(String name, Object def)Returns the data associated to a column or a default value.default <T> TgetDataOrDef(ColumnTemplate<T> column)Returns the data associated to a column or the column default value.default <T> TgetDataOrNull(ColumnTemplate<T> column)Returns the data associated to a column ornull.<T> TgetDataOrNull(Class<T> cls, String name)Returns the data associated to a column ornull.ObjectgetDataOrNull(String name)Returns the data associated to a column ornull.List<cdc.issues.Issue>getIssues()cdc.issues.locations.WorkbookLocationgetLocation()intgetNumber()Returns the number (1-based) of this row.StringgetRawDataOrNull(String name)Returns the raw data associated to a column ornull.StringgetSheetName()StringgetSystemId()SheetTemplategetTemplate()booleanisEmpty()default booleanisErase(ColumnTemplate<?> column)Returnstrueif the data associated to column must be erased.booleanisErase(String name)Returnstrueif the data associated to column must be erased.
-
-
-
Field Detail
-
ERASE
static final String ERASE
- See Also:
- Constant Field Values
-
-
Method Detail
-
getSystemId
String getSystemId()
- Returns:
- The systemId of the imported data.
-
getSheetName
String getSheetName()
- Returns:
- The sheet name of the imported row.
-
getTemplate
SheetTemplate getTemplate()
- Returns:
- The associated template.
-
getNumber
int getNumber()
Returns the number (1-based) of this row.The first data row should start at 2.
- Returns:
- The row number (1-based).
-
getAction
ImportAction getAction()
- Returns:
- The action to be taken for this row.
-
isErase
boolean isErase(String name)
Returnstrueif the data associated to column must be erased.- Parameters:
name- The column name.- Returns:
trueif the data associated to column namednamemust be erased.
-
isErase
default boolean isErase(ColumnTemplate<?> column)
Returnstrueif the data associated to column must be erased.- Parameters:
column- The column.- Returns:
trueif the data associated tocolumnmust be erased.
-
getRawDataOrNull
String getRawDataOrNull(String name)
Returns the raw data associated to a column ornull.- Parameters:
name- The column name.- Returns:
- The raw data associated to column named
nameornull.
-
getDataOrNull
Object getDataOrNull(String name)
Returns the data associated to a column ornull.If data must be erased,
nullis returned.- Parameters:
name- The column name.- Returns:
- The data associated to column named
nameornull.
-
getData
default Object getData(String name, Object def)
Returns the data associated to a column or a default value.If data must be erased, the default value
defis returned.- Parameters:
name- The column name.def- The default value.- Returns:
- The data associated to column named
nameordef.
-
getDataOrNull
<T> T getDataOrNull(Class<T> cls, String name)
Returns the data associated to a column ornull.WARNING: if data must be erased,
nullis returned.- Type Parameters:
T- The result type.- Parameters:
cls- The result class.name- The column name.- Returns:
- The data associated to column named
nameornull. - Throws:
ClassCastException- When the associated data can not be converted tocls
-
getData
default <T> T getData(Class<T> cls, String name, T def)
Returns the data associated to a column or a default value.WARNING: if data must be erased, the default value
defis returned.- Type Parameters:
T- The result type.- Parameters:
cls- The result class.name- The column name.def- The default value.- Returns:
- The data associated to column named
nameordef. - Throws:
ClassCastException- When the associated data can not be converted tocls
-
getDataOrNull
default <T> T getDataOrNull(ColumnTemplate<T> column)
Returns the data associated to a column ornull.WARNING: if data must be erased,
nullis returned.- Type Parameters:
T- The result type.- Parameters:
column- The column.- Returns:
- The data associated to
columnornull. - Throws:
ClassCastException- When the associated data can not be converted tocolumndata type.
-
getData
default <T> T getData(ColumnTemplate<T> column, T def)
Returns the data associated to a column or a default value.WARNING: if data must be erased, the default value
defis returned.- Type Parameters:
T- The result type.- Parameters:
column- The column.def- The default value.- Returns:
- The data associated to
columnordef. - Throws:
ClassCastException- When the associated data can not be converted tocolumndata type.
-
getDataOrDef
default <T> T getDataOrDef(ColumnTemplate<T> column)
Returns the data associated to a column or the column default value.WARNING: if data must be erased, the column default value is returned.
- Type Parameters:
T- The result type.- Parameters:
column- The column.- Returns:
- The data associated to
columnor the column default value (ColumnTemplate.getDef()).
-
getIssues
List<cdc.issues.Issue> getIssues()
- Returns:
- The issues associated to this row.
-
canBeProcessed
boolean canBeProcessed()
- Returns:
trueif this row can be processed.
There are no CRITICAL (or more severe) issues.
-
isEmpty
boolean isEmpty()
- Returns:
trueif this row is empty. This may happen when rows are removed from a sheet.
-
getLocation
cdc.issues.locations.WorkbookLocation getLocation()
- Returns:
- The location corresponding to this row.
-
-