public class SpiExporterRetriever extends Object implements ExporterRetriever<ExporterDescription>
ExporterRetriever
as services
.Constructor and Description |
---|
SpiExporterRetriever(ClassLoader serviceClassLoader)
Creates a new instance.
|
SpiExporterRetriever(List<? extends ExporterRetriever<?>> elements)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
<V> ModelOutput<V> |
createOutput(DataModelDefinition<V> definition,
ExporterDescription description,
TestContext context)
Creates a
ModelOutput to prepare what the exporter will use. |
<V> DataModelSource |
createSource(DataModelDefinition<V> definition,
ExporterDescription description,
TestContext context)
Creates a
DataModelSource to retrieve what the target exporter had created. |
Class<ExporterDescription> |
getDescriptionClass()
Returns the class of target
ExporterDescription . |
void |
truncate(ExporterDescription description,
TestContext context)
Truncates all resources which the exporter will use.
|
public SpiExporterRetriever(ClassLoader serviceClassLoader)
serviceClassLoader
- the class loader to load the registered servicesIllegalArgumentException
- if some parameters were null
public SpiExporterRetriever(List<? extends ExporterRetriever<?>> elements)
elements
- the elements to be composedIllegalArgumentException
- if some parameters were null
public Class<ExporterDescription> getDescriptionClass()
ExporterRetriever
ExporterDescription
.getDescriptionClass
in interface ExporterRetriever<ExporterDescription>
public void truncate(ExporterDescription description, TestContext context) throws IOException
ExporterRetriever
If target resources do not support truncate operations, this method has no effects.
truncate
in interface ExporterRetriever<ExporterDescription>
description
- the descriptioncontext
- the current test contextIOException
- if failed to open the targetpublic <V> ModelOutput<V> createOutput(DataModelDefinition<V> definition, ExporterDescription description, TestContext context) throws IOException
ExporterRetriever
ModelOutput
to prepare what the exporter will use.createOutput
in interface ExporterRetriever<ExporterDescription>
V
- type of modeldefinition
- the data model definitiondescription
- the descriptioncontext
- the current test contextModelOutput
IOException
- if failed to open the targetpublic <V> DataModelSource createSource(DataModelDefinition<V> definition, ExporterDescription description, TestContext context) throws IOException
ExporterRetriever
DataModelSource
to retrieve what the target exporter had created.createSource
in interface ExporterRetriever<ExporterDescription>
V
- type of modeldefinition
- the data model definitiondescription
- the descriptioncontext
- the current test contextDataModelSource
IOException
- if failed to open the targetCopyright © 2011–2019 Asakusa Framework Team. All rights reserved.