Package io.jmix.gridexportui.exporter
Class AbstractTableExporter<T extends AbstractTableExporter>
java.lang.Object
io.jmix.gridexportui.exporter.AbstractTableExporter<T>
- All Implemented Interfaces:
TableExporter
- Direct Known Subclasses:
ExcelExporter
,JsonExporter
public abstract class AbstractTableExporter<T extends AbstractTableExporter>
extends Object
implements TableExporter
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.jmix.gridexportui.exporter.TableExporter
TableExporter.ColumnValueContext
-
Field Summary
Modifier and TypeFieldDescriptionprotected Map<String,
Function<TableExporter.ColumnValueContext, Object>> protected CoreProperties
protected DatatypeRegistry
protected String
protected Messages
protected MessageTools
protected MetadataTools
protected UiProperties
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addColumnValueProvider
(String columnId, Function<TableExporter.ColumnValueContext, Object> columnValueProvider) Adds a function to get value from the column.protected Function<Object,
InstanceContainer<Object>> createInstanceContainerProvider
(DataGrid dataGrid, Object item) protected String
formatValue
(Object cellValue) protected String
formatValue
(Object cellValue, MetaPropertyPath metaPropertyPath) protected Object
getColumnValue
(DataGrid dataGrid, DataGrid.Column column, Object instance) protected Object
getColumnValue
(Table table, Table.Column column, Object instance) getColumnValueProvider
(String columnId) protected String
getFileName
(DataGrid<Object> dataGrid) protected String
getFileName
(Table<Object> table) protected String
getMetaClassName
(MetaClass metaClass) void
removeColumnValueProvider
(String columnId) Removes an column value provider function by column id.void
setFileName
(String fileName) withFileName
(String fileName) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.jmix.gridexportui.exporter.TableExporter
exportDataGrid, exportTable, getCaption
-
Field Details
-
messageTools
-
messages
-
metadataTools
-
datatypeRegistry
-
uiProperties
-
coreProperties
-
fileName
-
columnValueProviders
-
-
Constructor Details
-
AbstractTableExporter
public AbstractTableExporter()
-
-
Method Details
-
getFileName
-
setFileName
-
withFileName
-
addColumnValueProvider
public void addColumnValueProvider(String columnId, Function<TableExporter.ColumnValueContext, Object> columnValueProvider) Description copied from interface:TableExporter
Adds a function to get value from the column.- Specified by:
addColumnValueProvider
in interfaceTableExporter
- Parameters:
columnId
- column idcolumnValueProvider
- column value provider function
-
removeColumnValueProvider
Description copied from interface:TableExporter
Removes an column value provider function by column id.- Specified by:
removeColumnValueProvider
in interfaceTableExporter
- Parameters:
columnId
- column id
-
getColumnValueProvider
@Nullable public Function<TableExporter.ColumnValueContext,Object> getColumnValueProvider(String columnId) - Specified by:
getColumnValueProvider
in interfaceTableExporter
- Parameters:
columnId
- column id- Returns:
- column value provider function for the column id
-
getMetaClassName
-
getFileName
-
getFileName
-
getColumnValue
-
getColumnValue
@Nullable protected Object getColumnValue(DataGrid dataGrid, DataGrid.Column column, Object instance) -
createInstanceContainerProvider
-
formatValue
-
formatValue
-