Commit cf976dfa authored by Hoda Anvari Kazemabad's avatar Hoda Anvari Kazemabad
Browse files

New DataPathConfigParse

parent 30e5b9dd
Pipeline #101556 failed with stages
in 10 minutes and 54 seconds
package de.monticore.lang.monticar.cnnarch.mxnetgenerator;
import de.monticore.lang.monticar.cnntrain._symboltable.*;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class DataPathConfigParser {
private String configTargetPath;
ConfigurationSymbol configuration;
private String configFileName;
public DataPathConfigParser (ConfigurationSymbol configuration) {
this.configuration = configuration;
setConfigPath("./target/");
setConfigFileName("ConfigChainAutomation");
}
public String getConfigFileName() {
return configFileName;
}
public void setConfigFileName(String configFileName){
this.configFileName = configFileName + ".cnnt";
}
public String getConfigPath() {
if (configTargetPath.charAt(configTargetPath.length() - 1) != '/') {
this.configTargetPath = configTargetPath + "/";
}
return configTargetPath;
}
public void setConfigPath(String configTargetPath){
this.configTargetPath = configTargetPath + getConfigFileName;
}
public ConfigurationSymbol getConfiguration() {
return configuration;
}
public String getDataPath(String componentName) {
if (!getConfiguration().getEntryMap().containsKey(componentName)) {
return null;
}
return String.valueOf(getConfiguration().getEntry(componentName).getValue());
}
}
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment