Class ExporterRegistry
java.lang.Object
com.e1c.langtool.internal.stat.export.ExporterRegistry
- All Implemented Interfaces:
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetExporter(ExportFormat format) Retrieves the exporter associated with the specified format.voidregisterExporter(ExportFormat format, IStatisticsExporter exporter) Registers an exporter with the specified format.
-
Constructor Details
-
ExporterRegistry
public ExporterRegistry()
-
-
Method Details
-
registerExporter
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:
registerExporterin interfaceIExporterRegistry- Parameters:
format- TheExportFormatfor which the exporter is to be registered. Must not benull.exporter- TheIStatisticsExporterinstance to be associated with the specified format. Must not benull.
-
getExporter
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, anIllegalArgumentExceptionis thrown, indicating the format is unsupported.- Specified by:
getExporterin interfaceIExporterRegistry- Parameters:
format- TheExportFormatfor which the exporter is to be retrieved. Must not benull.- Returns:
- The
IStatisticsExporterinstance registered for the specified format. - Throws:
IllegalArgumentException- If no exporter is registered for the specified format.
-