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 Metadata
Fields inherited from class io.jmix.gridexportflowui.exporter.AbstractDataGridExporter
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
(com.vaadin.flow.component.grid.Grid<Object> dataGrid, Object entity, Predicate<com.vaadin.flow.component.grid.Grid.Column<Object>> columnFilter) void
exportDataGrid
(Downloader downloader, com.vaadin.flow.component.grid.Grid<Object> dataGrid, ExportMode exportMode, Predicate<com.vaadin.flow.component.grid.Grid.Column<Object>> columnFilter) ExportsDataGrid
content usingDownloader
.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
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.jmix.gridexportflowui.exporter.DataGridExporter
exportDataGrid
-
Field Details
-
metadata
-
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, Predicate<com.vaadin.flow.component.grid.Grid.Column<Object>> columnFilter) Description copied from interface:DataGridExporter
ExportsDataGrid
content usingDownloader
.- Parameters:
downloader
-Downloader
instancedataGrid
-DataGrid
to get contentexportMode
- exportModecolumnFilter
- filter of theGrid.Column
-
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
-