Class JsonExporter
java.lang.Object
io.jmix.gridexportui.exporter.AbstractTableExporter<JsonExporter>
io.jmix.gridexportui.exporter.json.JsonExporter
- All Implemented Interfaces:
TableExporter
@Component("grdexp_JsonExporter")
@Scope("prototype")
public class JsonExporter
extends AbstractTableExporter<JsonExporter>
Use this class to export
Just create an instance of
Table
into JSON format.
Just create an instance of
ExportAction
with withExporter
method.-
Nested Class Summary
Nested classes/interfaces inherited from interface io.jmix.gridexportui.exporter.TableExporter
TableExporter.ColumnValueContext
-
Field Summary
Modifier and TypeFieldDescriptionprotected Function<com.google.gson.GsonBuilder,
com.google.gson.GsonBuilder> protected Metadata
Fields inherited from class io.jmix.gridexportui.exporter.AbstractTableExporter
columnValueProviders, coreProperties, datatypeRegistry, fileName, messages, messageTools, metadataTools, uiProperties
-
Constructor Summary
ConstructorDescriptionJsonExporter
(Metadata metadata, AllEntitiesLoaderFactory allEntitiesLoaderFactory) -
Method Summary
Modifier and TypeMethodDescriptionprotected com.google.gson.Gson
protected com.google.gson.JsonObject
createJsonObjectFromEntity
(DataGrid<Object> dataGrid, Object entity) protected com.google.gson.JsonObject
createJsonObjectFromEntity
(Table<Object> table, Object entity) void
exportDataGrid
(Downloader downloader, DataGrid<Object> dataGrid, ExportMode exportMode) downloaddataGrid
content viadownloader
void
exportTable
(Downloader downloader, Table<Object> table, ExportMode exportMode) downloadtable
content viadownloader
returns exporter captionprotected Collection<Object>
getItems
(DataGrid<Object> dataGrid, ExportMode exportMode) protected Collection<Object>
getItems
(Table<Object> table, ExportMode exportMode) withGsonConfigurator
(Function<com.google.gson.GsonBuilder, com.google.gson.GsonBuilder> gsonConfigurator) Configure Gson builder for exportMethods inherited from class io.jmix.gridexportui.exporter.AbstractTableExporter
addColumnValueProvider, createInstanceContainerProvider, formatValue, formatValue, getColumnValue, getColumnValue, getColumnValueProvider, getFileName, getFileName, getFileName, getMetaClassName, removeColumnValueProvider, setFileName, withFileName
-
Field Details
-
metadata
-
gsonConfigurer
-
-
Constructor Details
-
JsonExporter
-
-
Method Details
-
withGsonConfigurator
public JsonExporter withGsonConfigurator(Function<com.google.gson.GsonBuilder, com.google.gson.GsonBuilder> gsonConfigurator) Configure Gson builder for export- Parameters:
gsonConfigurator
- Gson configurator function- Returns:
- exporter instance
-
exportTable
Description copied from interface:TableExporter
downloadtable
content viadownloader
-
exportDataGrid
Description copied from interface:TableExporter
downloaddataGrid
content viadownloader
-
createJsonObjectFromEntity
-
createJsonObjectFromEntity
-
createGsonForSerialization
protected com.google.gson.Gson createGsonForSerialization() -
getItems
-
getItems
-
getCaption
Description copied from interface:TableExporter
returns exporter caption
-