Class JsonExporter
java.lang.Object
io.jmix.gridexportflowui.exporter.AbstractDataGridExporter<JsonExporter>
io.jmix.gridexportflowui.exporter.json.JsonExporter
- All Implemented Interfaces:
DataGridExporter
@Component("grdexp_JsonExporter")
@Scope("prototype")
public class JsonExporter
extends AbstractDataGridExporter<JsonExporter>
Use this class to export
Just create an instance of
DataGrid
into JSON format.
Just create an instance of
ExportAction
with withExporter
method.-
Nested Class Summary
Nested classes/interfaces inherited from interface io.jmix.gridexportflowui.exporter.DataGridExporter
DataGridExporter.ColumnValueContext
-
Field Summary
Modifier and TypeFieldDescriptionprotected Function<com.google.gson.GsonBuilder,
com.google.gson.GsonBuilder> protected JsonAllRecordsExporter
protected Metadata
Fields inherited from class io.jmix.gridexportflowui.exporter.AbstractDataGridExporter
columnValueProviders, coreProperties, datatypeRegistry, fileName, messages, messageTools, metadataTools, uiProperties
-
Constructor Summary
ConstructorDescriptionJsonExporter
(Metadata metadata, JsonAllRecordsExporter jsonAllRecordsExporter) -
Method Summary
Modifier and TypeMethodDescriptionprotected com.google.gson.Gson
protected com.google.gson.JsonObject
createJsonObjectFromEntity
(com.vaadin.flow.component.grid.Grid<Object> dataGrid, Object entity) void
exportDataGrid
(Downloader downloader, com.vaadin.flow.component.grid.Grid<Object> dataGrid, ExportMode exportMode) downloaddataGrid
content viadownloader
protected Collection<Object>
getDataGridItems
(com.vaadin.flow.component.grid.Grid<Object> dataGrid) protected Collection<Object>
getItems
(com.vaadin.flow.component.grid.Grid<Object> dataGrid, ExportMode exportMode) getLabel()
protected JsonExporter
withGsonConfigurator
(Function<com.google.gson.GsonBuilder, com.google.gson.GsonBuilder> gsonConfigurer) Configure Gson builder for exportMethods inherited from class io.jmix.gridexportflowui.exporter.AbstractDataGridExporter
addColumnValueProvider, createInstanceContainerProvider, formatValue, formatValue, getColumnValue, getColumnValueProvider, getFileName, getFileName, getMetaClassName, removeColumnValueProvider, setCoreProperties, setDatatypeRegistry, setFileName, setMessages, setMessageTools, setMetadataTools, setUiProperties, withFileName
-
Field Details
-
metadata
-
jsonAllRecordsExporter
-
gsonConfigurer
-
-
Constructor Details
-
JsonExporter
-
-
Method Details
-
withGsonConfigurator
protected JsonExporter withGsonConfigurator(Function<com.google.gson.GsonBuilder, com.google.gson.GsonBuilder> gsonConfigurer) Configure Gson builder for export- Parameters:
gsonConfigurer
- Gson configurator function- Returns:
- exporter instance
-
exportDataGrid
public void exportDataGrid(Downloader downloader, com.vaadin.flow.component.grid.Grid<Object> dataGrid, ExportMode exportMode) Description copied from interface:DataGridExporter
downloaddataGrid
content viadownloader
-
createJsonObjectFromEntity
-
createGsonForSerialization
protected com.google.gson.Gson createGsonForSerialization() -
getItems
protected Collection<Object> getItems(com.vaadin.flow.component.grid.Grid<Object> dataGrid, ExportMode exportMode) -
getDataGridItems
-
getLabel
- Returns:
- exporter label
-