use of org.eclipse.vorto.codegen.gateway.model.Generator in project vorto by eclipse.
the class VortoService method generate.
public IGenerationResult generate(String key, String namespace, String name, String version, Map<String, String> parameters) {
LOGGER.info(String.format("Generating for Platform [%s] and Model [%s.%s:%s]", key, namespace, name, version));
Generator generator = repo.get(key).orElseThrow(GatewayUtils.notFound(String.format("[Generator %s]", key)));
InformationModel model = getModel(namespace, name, version).orElseThrow(GatewayUtils.notFound(String.format("[Model %s.%s:%s]", namespace, name, version)));
List<MappingModel> mappings = getMappings(key, namespace, name, version);
InvocationContext invocationContext = new InvocationContext(mappings, repo.newGeneratorLookup(), parameters);
return generate(generator.getInstance(), model, invocationContext);
}
Aggregations