72 lines
1.9 KiB
Java
72 lines
1.9 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.GlobalConfig;
|
|
import org.gcube.common.software.model.SoftwareVersionConfig;
|
|
|
|
/**
|
|
* @author Luca Frosini (ISTI - CNR)
|
|
*/
|
|
public abstract class SoftwareVersionExporter {
|
|
|
|
protected static Map<String, Class<? extends SoftwareVersionExporter>> processors;
|
|
|
|
static {
|
|
processors = new HashMap<>();
|
|
add(ZenodoSoftwareVersionExporter.class);
|
|
add(BibLaTeXSoftwareVersionExporter.class);
|
|
}
|
|
|
|
private static void add(Class<? extends SoftwareVersionExporter> clz) {
|
|
processors.put(clz.getSimpleName(), clz);
|
|
}
|
|
|
|
public static Map<String, Class<? extends SoftwareVersionExporter>> getAvailableExporters() {
|
|
return processors;
|
|
}
|
|
|
|
protected GlobalConfig globalConfig;
|
|
protected SoftwareVersionConfig softwareVersionConfig;
|
|
protected ExporterConfig processorConfig;
|
|
protected boolean first;
|
|
|
|
public GlobalConfig getGlobalConfig() {
|
|
return globalConfig;
|
|
}
|
|
|
|
public void setGlobalConfig(GlobalConfig softwareConfig) {
|
|
this.globalConfig = softwareConfig;
|
|
}
|
|
|
|
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;
|
|
}
|