Package cdc.impex
Class ImpExCatalog
java.lang.Object
cdc.impex.ImpExCatalog
Catalog of
SheetTemplates and SheetImporters.- Author:
- Damien Carbonne
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateWorkbookExporterFor(WorkbookExporter def, String... templateNames) Creates a delegating sheet exporter for an array of template names.createWorkbookExporterFor(WorkbookExporter def, Collection<String> templateNames) Creates a delegating sheet exporter for a collection of template names.createWorkbookExporterFor(String... templateNames) createWorkbookExporterFor(Collection<String> templateNames) createWorkbookImporterFor(WorkbookImporter def, String... templateNames) Creates a delegating sheet importer for an array of template names.createWorkbookImporterFor(WorkbookImporter def, Collection<String> templateNames) Creates a delegating sheet importer for a collection of template names.createWorkbookImporterFor(String... templateNames) createWorkbookImporterFor(Collection<String> templateNames) getDomainTemplatesAsList(String domain) Returns a list of sheet templates associated to a domain.getDomainTemplatesAsSet(String domain) Returns a set of sheet templates associated to a domain.getSheetExporter(String templateName) Return The sheet exporter associated to template name.getSheetExporterOrNull(String templateName) Returns sheet exporter associated to a template name ornull.getSheetImporter(String templateName) Return The sheet importer associated to template name.getSheetImporterOrNull(String templateName) Returns sheet importer associated to a template name ornull.getTemplate(String templateName) getTemplateOrNull(String templateName) getTemplatesAsList(String... templateNames) getTemplatesAsList(Collection<String> templateNames) getTemplatesAsSet(String... templateNames) getTemplatesAsSet(Collection<String> templateNames) register(SheetTemplate template) Registers a SheetTemplate.register(SheetTemplate... templates) Registers an array of SheetTemplates.register(SheetTemplate template, SheetExporter sheetExporter) Registers a SheetTemplate (if not already done) and associate it to a SheetExporter.register(SheetTemplate template, SheetImporter sheetImporter) Registers a SheetTemplate (if not already done) and associate it to a SheetImporter.register(String templateName, SheetExporter sheetExporter) Registers a SheetExporter and associate it to a template name.register(String templateName, SheetImporter sheetImporter) Registers a SheetImporter and associate it to a template name.register(Collection<SheetTemplate> templates) Registers a collection of SheetTemplates.
-
Constructor Details
-
ImpExCatalog
public ImpExCatalog()
-
-
Method Details
-
register
Registers a SheetTemplate.- Parameters:
template- The sheet template.- Returns:
- This catalog.
- Throws:
IllegalArgumentException- Whentemplateisnull, or another template with that name is already registered.
-
register
Registers a collection of SheetTemplates.- Parameters:
templates- The sheet templates.- Returns:
- This catalog.
- Throws:
IllegalArgumentException- Whentemplatesisnull, or another template with same name is already registered.
-
register
Registers an array of SheetTemplates.- Parameters:
templates- The sheet templates.- Returns:
- This catalog.
- Throws:
IllegalArgumentException- Whentemplatesisnull, or another template with same name is already registered.
-
register
Registers a SheetImporter and associate it to a template name.- Parameters:
templateName- The template name.sheetImporter- The sheet importer.- Returns:
- This catalog.
- Throws:
IllegalArgumentException- WhentemplateNameorsheetImporterisnull,
or that would create a duplicate or no corresponding template is found.
-
register
Registers a SheetTemplate (if not already done) and associate it to a SheetImporter.- Parameters:
template- The sheet template.sheetImporter- The sheet importer.- Returns:
- This catalog.
- Throws:
IllegalArgumentException- WhentemplateorsheetImporterisnull,
or that would create a duplicate.
-
register
Registers a SheetExporter and associate it to a template name.- Parameters:
templateName- The template name.sheetExporter- The sheet exporter.- Returns:
- This catalog.
- Throws:
IllegalArgumentException- WhentemplateNameorsheetExporterisnull,
or that would create a duplicate or no corresponding template is found.
-
register
Registers a SheetTemplate (if not already done) and associate it to a SheetExporter.- Parameters:
template- The sheet template.sheetExporter- The sheet exporter.- Returns:
- This catalog.
- Throws:
IllegalArgumentException- WhentemplateorsheetExporterisnull,
or that would create a duplicate.
-
getDomainNames
- Returns:
- A set of domain names for which some sheet templates are registered.
-
getDomainTemplatesAsSet
Returns a set of sheet templates associated to a domain.- Parameters:
domain- The domain.- Returns:
- A set of sheet templates associated to
domain.
-
getDomainTemplatesAsList
Returns a list of sheet templates associated to a domain.- Parameters:
domain- The domain.- Returns:
- A list of sheet templates associated to
domain.
-
getTemplateNames
- Returns:
- A set of names of registered sheet templates.
-
getTemplateOrNull
- Parameters:
templateName- The template name.- Returns:
- The registered sheet template named
nameornull.
-
getTemplate
- Parameters:
templateName- The template name.- Returns:
- The registered sheet template named
name. - Throws:
cdc.util.lang.NotFoundException- When no sheet template namedtemplateNameis registered.
-
getTemplatesAsSet
- Parameters:
templateNames- The template names.- Returns:
- A set if templates from
templateNames. - Throws:
IllegalArgumentException- WhentemplateNamesisnull.
-
getTemplatesAsList
-
getTemplatesAsSet
- Parameters:
templateNames- The template names.- Returns:
- A set if templates from
templateNames. - Throws:
IllegalArgumentException- WhentemplateNamesisnull.
-
getTemplatesAsList
-
getImportableTemplateNames
- Returns:
- A set of sheet template names for which an sheet importer is registered.
-
getExtractableTemplateNames
- Returns:
- A set of sheet template names for which an sheet exporter is registered.
-
getTemplates
- Returns:
- A set of all registered templates.
-
getSheetImporterOrNull
Returns sheet importer associated to a template name ornull.- Parameters:
templateName- The template name.- Returns:
- The sheet importer associated to
templateNameornull.
-
getSheetImporter
Return The sheet importer associated to template name.- Parameters:
templateName- The template name.- Returns:
- The sheet importer associated to
templateName. - Throws:
cdc.util.lang.NotFoundException- When no sheet importer is associated totemplateName.
-
createWorkbookImporterFor
public WorkbookImporter createWorkbookImporterFor(WorkbookImporter def, Collection<String> templateNames) Creates a delegating sheet importer for a collection of template names.- Parameters:
def- The default sheet importer.templateNames- The template names.- Returns:
- A newly created sheet importer.
-
createWorkbookImporterFor
-
createWorkbookImporterFor
Creates a delegating sheet importer for an array of template names.- Parameters:
def- The default sheet importer.templateNames- The template names.- Returns:
- A newly created sheet importer.
-
createWorkbookImporterFor
-
getSheetExporterOrNull
Returns sheet exporter associated to a template name ornull.- Parameters:
templateName- The template name.- Returns:
- The sheet exporter associated to
templateNameornull.
-
getSheetExporter
Return The sheet exporter associated to template name.- Parameters:
templateName- The template name.- Returns:
- The sheet exporter associated to
templateName. - Throws:
cdc.util.lang.NotFoundException- When no sheet exporter is associated totemplateName.
-
createWorkbookExporterFor
public WorkbookExporter createWorkbookExporterFor(WorkbookExporter def, Collection<String> templateNames) Creates a delegating sheet exporter for a collection of template names.- Parameters:
def- The default sheet exporter.templateNames- The template names.- Returns:
- A newly created sheet exporter.
-
createWorkbookExporterFor
-
createWorkbookExporterFor
Creates a delegating sheet exporter for an array of template names.- Parameters:
def- The default sheet exporter.templateNames- The template names.- Returns:
- A newly created sheet exporter.
-
createWorkbookExporterFor
-