use of org.eol.globi.data.ParserFactoryForDataset in project eol-globi-data by jhpoelen.
the class GitHubImporterFactory method createImporter.
public StudyImporter createImporter(Dataset dataset, final NodeFactory nodeFactory) throws StudyImporterException {
Class<? extends StudyImporter> anImporter = findImporterFor(dataset);
try {
Constructor<? extends StudyImporter> constructor = anImporter.getConstructor(ParserFactory.class, NodeFactory.class);
ParserFactoryForDataset parserFactory = new ParserFactoryForDataset(dataset);
StudyImporter studyImporter = constructor.newInstance(parserFactory, new NodeFactoryWithDatasetContext(nodeFactory, dataset));
studyImporter.setDataset(dataset);
return studyImporter;
} catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException | InstantiationException e) {
throw new StudyImporterException("failed to instantiate importer for [" + dataset.getNamespace() + "]", e);
}
}
Aggregations