65 lines
1.7 KiB
Java
65 lines
1.7 KiB
Java
package org.gcube.common.software.export;
|
|
|
|
import java.util.HashMap;
|
|
import java.util.Map;
|
|
|
|
import org.gcube.common.software.export.biblatex.BibLaTeXSoftwareVersionExporter;
|
|
import org.gcube.common.software.export.zenodo.ZenodoSoftwareVersionExporter;
|
|
import org.gcube.common.software.model.ExporterConfig;
|
|
import org.gcube.common.software.model.SoftwareVersionConfig;
|
|
|
|
/**
|
|
* @author Luca Frosini (ISTI - CNR)
|
|
*/
|
|
public abstract class SoftwareVersionExporter {
|
|
|
|
protected static Map<String, Class<? extends SoftwareVersionExporter>> availableExporters;
|
|
|
|
static {
|
|
availableExporters = new HashMap<>();
|
|
add(ZenodoSoftwareVersionExporter.class);
|
|
add(BibLaTeXSoftwareVersionExporter.class);
|
|
}
|
|
|
|
private static void add(Class<? extends SoftwareVersionExporter> clz) {
|
|
availableExporters.put(clz.getSimpleName(), clz);
|
|
}
|
|
|
|
public static Map<String, Class<? extends SoftwareVersionExporter>> getAvailableExporters() {
|
|
return availableExporters;
|
|
}
|
|
|
|
protected SoftwareVersionConfig softwareVersionConfig;
|
|
protected ExporterConfig processorConfig;
|
|
protected boolean first;
|
|
|
|
protected String fileExtension;
|
|
protected String output;
|
|
|
|
public SoftwareVersionConfig getSoftwareVersionConfig() {
|
|
return softwareVersionConfig;
|
|
}
|
|
|
|
public void setSoftwareVersion(SoftwareVersionConfig softwareVersionConfig) {
|
|
this.softwareVersionConfig = softwareVersionConfig;
|
|
}
|
|
|
|
public ExporterConfig getExporterConfig() {
|
|
return processorConfig;
|
|
}
|
|
|
|
public void setExporterConfig(ExporterConfig processorConfig) {
|
|
this.processorConfig = processorConfig;
|
|
}
|
|
|
|
public boolean isFirst() {
|
|
return first;
|
|
}
|
|
|
|
public void setFirst(boolean first) {
|
|
this.first = first;
|
|
}
|
|
|
|
public abstract void export() throws Exception;
|
|
}
|