Class JsonExporter

All Implemented Interfaces:
TableExporter

@Component("ui_JsonExporter") @Scope("prototype") public class JsonExporter extends AbstractTableExporter<JsonExporter>
Use this class to export Table into JSON format.
Just create an instance of ExportAction with withExporter method.
  • Field Details

    • metadata

      @Autowired protected Metadata metadata
    • gsonConfigurer

      protected Function<com.google.gson.GsonBuilder,com.google.gson.GsonBuilder> gsonConfigurer
  • Constructor Details

    • JsonExporter

      public 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

      public void exportTable(Downloader downloader, Table<Object> table, ExportMode exportMode)
      Description copied from interface: TableExporter
      download table content via downloader
    • exportDataGrid

      public void exportDataGrid(Downloader downloader, DataGrid<Object> dataGrid, ExportMode exportMode)
      Description copied from interface: TableExporter
      download dataGrid content via downloader
    • createGsonForSerialization

      protected com.google.gson.Gson createGsonForSerialization()
    • getItems

      protected Collection<Object> getItems(Table<Object> table, ExportMode exportMode)
    • getItems

      protected Collection<Object> getItems(DataGrid<Object> dataGrid, ExportMode exportMode)
    • getCaption

      public String getCaption()
      Description copied from interface: TableExporter
      returns exporter caption