public class ExcelTableManager extends Object
ExcelTable.| Constructor and Description |
|---|
ExcelTableManager(Class<? extends DataClass> aExcelTable)
A constructor which calls some methods to check if the given class is
valid for im-/exporting.
Warning: The validation methods will call IllegalStateExceptions if the class is not valid.The class must accomplish the following conditions: The class can't be null. The class must be annotated with ExcelTable
If a mapping file is listed it must exist.
The listed DataController must be able to handle the
class.
The class must contain a setter method for every importable field (a
field with ExcelField.importable() == true).
The class must contain a getter method for every exportable field (a
field with ExcelField.exportable() == true).
The setter methods must look like this:public void set[FieldName]([Type] ...) The getter methods must look like this: public [Type] get[FieldName] |
| Modifier and Type | Method and Description |
|---|---|
Class<? extends DataController<? extends DataClass>> |
getDataController() |
Optional<Field> |
getExcelField(String aFieldName)
Searches for a
ExcelField with the given field name. |
Collection<Field> |
getExcelFields() |
Class<? extends DataClass> |
getExcelTableClass() |
Collection<Field> |
getExportableExcelFields() |
Collection<Field> |
getImportableExcelFields() |
Collection<Field> |
getImportableRequiredExcelFields() |
Path |
getMappingFilePath() |
String |
getTableName()
Determines the table name.
|
boolean |
hasImportableField(String aFieldName)
Checks if a
ExcelField with the given name exists for the
dataclass of this manager. |
boolean |
hasMappingFilePath()
Checks if a mapping file path is listed.
|
public ExcelTableManager(Class<? extends DataClass> aExcelTable)
IllegalStateExceptions if the class is not valid.ExcelTableDataController must be able to handle the
class.ExcelField.importable() == true).ExcelField.exportable() == true).public void set[FieldName]([Type] ...) public [Type] get[FieldName]aExcelTable - The with ExcelTable annotated class.public Class<? extends DataController<? extends DataClass>> getDataController()
public Optional<Field> getExcelField(String aFieldName)
ExcelField with the given field name.aFieldName - The field name.Optional with the search result.public Collection<Field> getExcelFields()
public Collection<Field> getExportableExcelFields()
public Collection<Field> getImportableExcelFields()
public Collection<Field> getImportableRequiredExcelFields()
public Path getMappingFilePath()
public String getTableName()
ExcelTable.tableName() is not set.public boolean hasImportableField(String aFieldName)
ExcelField with the given name exists for the
dataclass of this manager.aFieldName - The field name.public boolean hasMappingFilePath()
Copyright © 2019. All rights reserved.