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