use of biblemulticonverter.format.ExportFormat in project BibleMultiConverter by schierlm.
the class ParatextConverter method run.
@Override
public void run(String... args) throws Exception {
Module<ImportFormat> importModule = Main.importFormats.get(args[0]);
Module<ExportFormat> exportModule = Main.exportFormats.get(args[2]);
AbstractParatextFormat importFormat = (AbstractParatextFormat) importModule.getImplementationClass().newInstance();
AbstractParatextFormat exportFormat = (AbstractParatextFormat) exportModule.getImplementationClass().newInstance();
List<ParatextBook> books = importFormat.doImportBooks(new File(args[1]));
exportFormat.doExportBooks(books, Arrays.copyOfRange(args, 3, args.length));
}
use of biblemulticonverter.format.ExportFormat in project BibleMultiConverter by schierlm.
the class Main method main.
public static void main(String[] args) throws Exception {
discoverModules();
if (args.length > 0) {
Module<Tool> toolModule = tools.get(args[0]);
if (toolModule != null) {
toolModule.getImplementationClass().newInstance().run(Arrays.copyOfRange(args, 1, args.length));
return;
}
}
if (args.length > 2) {
Module<ImportFormat> importModule = importFormats.get(args[0]);
Module<ExportFormat> exportModule = exportFormats.get(args[2]);
if (importModule != null && exportModule != null) {
Bible bible = importModule.getImplementationClass().newInstance().doImport(new File(args[1]));
exportModule.getImplementationClass().newInstance().doExport(bible, Arrays.copyOfRange(args, 3, args.length));
return;
}
}
System.out.println("Usage:");
System.out.println("java -jar BibleMultiConverter.jar <ImportFormat> <ImportFile> <ExportFormat> [<ExportArgs>...]");
System.out.println("java -jar BibleMultiConverter.jar <Tool> [<ToolArgs>...]");
printModules("import formats", importFormats);
printModules("export formats", exportFormats);
printModules("versification formats", versificationFormats);
printModules("tools", tools);
}
Aggregations