public abstract class AbstractTableExporter<T extends AbstractTableExporter> extends java.lang.Object implements TableExporter
TableExporter.ColumnValueContext
Modifier and Type | Field and Description |
---|---|
protected java.util.Map<java.lang.String,java.util.function.Function<TableExporter.ColumnValueContext,java.lang.Object>> |
columnValueProviders |
protected io.jmix.core.CoreProperties |
coreProperties |
protected io.jmix.core.metamodel.datatype.DatatypeRegistry |
datatypeRegistry |
protected java.lang.String |
fileName |
protected io.jmix.core.Messages |
messages |
protected io.jmix.core.MessageTools |
messageTools |
protected io.jmix.core.MetadataTools |
metadataTools |
protected UiProperties |
uiProperties |
Constructor and Description |
---|
AbstractTableExporter() |
Modifier and Type | Method and Description |
---|---|
void |
addColumnValueProvider(java.lang.String columnId,
java.util.function.Function<TableExporter.ColumnValueContext,java.lang.Object> columnValueProvider)
Adds a function to get value from the column.
|
protected java.util.function.Function<java.lang.Object,InstanceContainer<java.lang.Object>> |
createInstanceContainerProvider(DataGrid dataGrid,
java.lang.Object item) |
protected java.lang.String |
formatValue(java.lang.Object cellValue,
io.jmix.core.metamodel.model.MetaPropertyPath metaPropertyPath) |
protected java.lang.Object |
getColumnValue(DataGrid dataGrid,
DataGrid.Column column,
java.lang.Object instance) |
protected java.lang.Object |
getColumnValue(Table table,
Table.Column column,
java.lang.Object instance) |
java.util.function.Function<TableExporter.ColumnValueContext,java.lang.Object> |
getColumnValueProvider(java.lang.String columnId) |
java.lang.String |
getFileName() |
protected java.lang.String |
getFileName(DataGrid<java.lang.Object> dataGrid) |
protected java.lang.String |
getFileName(Table<java.lang.Object> table) |
protected java.lang.String |
getMetaClassName(io.jmix.core.metamodel.model.MetaClass metaClass) |
void |
removeColumnValueProvider(java.lang.String columnId)
Removes an column value provider function by column id.
|
void |
setFileName(java.lang.String fileName) |
T |
withFileName(java.lang.String fileName) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
exportDataGrid, exportTable, getCaption
@Autowired protected io.jmix.core.MessageTools messageTools
@Autowired protected io.jmix.core.Messages messages
@Autowired protected io.jmix.core.MetadataTools metadataTools
@Autowired protected io.jmix.core.metamodel.datatype.DatatypeRegistry datatypeRegistry
@Autowired protected UiProperties uiProperties
@Autowired protected io.jmix.core.CoreProperties coreProperties
protected java.lang.String fileName
protected java.util.Map<java.lang.String,java.util.function.Function<TableExporter.ColumnValueContext,java.lang.Object>> columnValueProviders
public java.lang.String getFileName()
public void setFileName(java.lang.String fileName)
public T withFileName(java.lang.String fileName)
public void addColumnValueProvider(java.lang.String columnId, java.util.function.Function<TableExporter.ColumnValueContext,java.lang.Object> columnValueProvider)
TableExporter
addColumnValueProvider
in interface TableExporter
columnId
- column idcolumnValueProvider
- column value provider functionpublic void removeColumnValueProvider(java.lang.String columnId)
TableExporter
removeColumnValueProvider
in interface TableExporter
columnId
- column id@Nullable public java.util.function.Function<TableExporter.ColumnValueContext,java.lang.Object> getColumnValueProvider(java.lang.String columnId)
getColumnValueProvider
in interface TableExporter
columnId
- column idprotected java.lang.String getMetaClassName(io.jmix.core.metamodel.model.MetaClass metaClass)
protected java.lang.String getFileName(Table<java.lang.Object> table)
protected java.lang.String getFileName(DataGrid<java.lang.Object> dataGrid)
protected java.lang.Object getColumnValue(Table table, Table.Column column, java.lang.Object instance)
protected java.lang.Object getColumnValue(DataGrid dataGrid, DataGrid.Column column, java.lang.Object instance)
protected java.util.function.Function<java.lang.Object,InstanceContainer<java.lang.Object>> createInstanceContainerProvider(DataGrid dataGrid, java.lang.Object item)
protected java.lang.String formatValue(@Nullable java.lang.Object cellValue, io.jmix.core.metamodel.model.MetaPropertyPath metaPropertyPath)