Commit fae0bbbf authored by Philip Makedonski's avatar Philip Makedonski
Browse files

* refined validation script loading for target platform deployment



Change-Id: Id324dc8d4235d2433695e16b28e5c8d4322d7589
Signed-off-by: Philip Makedonski's avatarmakedonski <makedonski@informatik.uni-goettingen.de>
parent d16e558c
......@@ -64,9 +64,18 @@ public class Validator {
//TODO: also for TO?
Bundle bundle = Platform.getBundle("org.etsi.mts.tdl.constraints");
String moduleSource = bundle.getLocation().substring(15)+source;
URL url = bundle.getEntry(source);
IEolExecutableModule module = loadModule(moduleSource);
IEolExecutableModule module = new EvlModule();
module.parse(url.toURI());
//TODO: integrate error reporting
if (module.getParseProblems().size() > 0) {
System.err.println("Parse errors occured...");
for (ParseProblem problem : module.getParseProblems()) {
System.err.println(problem.toString());
}
}
IModel tdlModel = getTDLModel(r, true, false);
tdlModel.load();
......@@ -94,30 +103,7 @@ public class Validator {
return violations;
}
private IEolExecutableModule loadModule(String source) throws Exception, URISyntaxException {
IEolExecutableModule module = null;
if (source.endsWith("etl")) {
module = new EtlModule();
} else if (source.endsWith("eol")) {
module = new EolModule();
} else if (source.endsWith("evl")) {
module = new EvlModule();
} else {
}
module.parse(new File(source));
if (module.getParseProblems().size() > 0) {
System.err.println("Parse errors occured...");
for (ParseProblem problem : module.getParseProblems()) {
System.err.println(problem.toString());
}
}
return module;
}
//TODO: extract to shared library
public IModel getTDLModel(Resource resource, boolean read, boolean write) throws Exception {
EmfModel model;
model = new InMemoryEmfModel("TDL", resource, tdlPackage.eINSTANCE);
......
Markdown is supported
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