use of org.eclipse.winery.yaml.common.exception.MultiException in project winery by eclipse.
the class SchemaVisitor method visit.
public Map<QName, Map<String, QName>> visit(TServiceTemplate node, Path path, Path outpath, String namespace) {
for (TMapImportDefinition map : node.getImports()) {
for (Map.Entry<String, TImportDefinition> entry : map.entrySet()) {
Reader reader = Reader.getReader();
try {
TServiceTemplate serviceTemplate = reader.parse(entry.getValue(), path, entry.getValue().getNamespaceUri());
visit(serviceTemplate, new Parameter(outpath, entry.getValue().getNamespaceUri()).setBuildSchema(false));
} catch (MultiException e) {
setException(e);
}
}
}
this.visit(node, new Parameter(outpath, namespace));
return propertyDefinition;
}
use of org.eclipse.winery.yaml.common.exception.MultiException in project winery by eclipse.
the class Showcases method convert.
public MultiException convert(String path, String namespace, Stream<String> files) throws Exception {
MultiException exception = new MultiException();
files.map(name -> {
try {
return new LinkedHashMap.SimpleEntry<>(name, readServiceTemplate(path + File.separator + name));
} catch (Exception e) {
exception.add(e);
}
return null;
}).filter(Objects::nonNull).map(entry -> new LinkedHashMap.SimpleEntry<>(entry.getKey(), convert(entry.getValue(), entry.getKey(), namespace))).forEach(entry -> WriterUtils.saveDefinitions(entry.getValue(), outPath, namespace, entry.getKey()));
if (exception.hasException()) {
throw exception.getException();
}
return exception;
}
Aggregations