Class ExporterRegistry

java.lang.Object
com.e1c.langtool.internal.stat.export.ExporterRegistry
All Implemented Interfaces:
IExporterRegistry

public class ExporterRegistry extends Object implements IExporterRegistry
Manages the registration and retrieval of IStatisticsExporter instances based on their ExportFormat. This registry allows for the dynamic association of export formats to specific exporter implementations, facilitating the export process based on the required output format. It implements the IExporterRegistry interface, providing methods to register and get exporters by format.
  • Constructor Details

    • ExporterRegistry

      public ExporterRegistry()
  • Method Details

    • registerExporter

      public void registerExporter(ExportFormat format, IStatisticsExporter exporter)
      Registers an exporter with the specified format. If an exporter for the given format already exists, it will be replaced by the new exporter. This method allows for the dynamic configuration of the export capabilities, enabling the application to support various export formats with specific implementations.
      Specified by:
      registerExporter in interface IExporterRegistry
      Parameters:
      format - The ExportFormat for which the exporter is to be registered. Must not be null.
      exporter - The IStatisticsExporter instance to be associated with the specified format. Must not be null.
    • getExporter

      public IStatisticsExporter getExporter(ExportFormat format)
      Retrieves the exporter associated with the specified format. This method facilitates the retrieval of an appropriate exporter to handle the export process for a given format. If no exporter is registered for the specified format, an IllegalArgumentException is thrown, indicating the format is unsupported.
      Specified by:
      getExporter in interface IExporterRegistry
      Parameters:
      format - The ExportFormat for which the exporter is to be retrieved. Must not be null.
      Returns:
      The IStatisticsExporter instance registered for the specified format.
      Throws:
      IllegalArgumentException - If no exporter is registered for the specified format.