use of com.spectralogic.ds3autogen.go.models.response.Response in project ds3_autogen by SpectraLogic.
the class GoCodeGenerator method generateResponse.
/**
* Generates the Go code for a response handler/parser
*/
private void generateResponse(final Ds3Request ds3Request) throws IOException, TemplateException {
final Template tmpl = getResponseTemplate(ds3Request);
final ResponseModelGenerator<?> generator = getResponseGenerator(ds3Request);
final Response response = generator.generate(ds3Request);
final Path path = destDir.resolve(BASE_PROJECT_PATH.resolve(Paths.get(COMMANDS_NAMESPACE.replace(".", "/") + "/" + uncapitalize(response.getName()) + ".go")));
LOG.info("Getting Output Stream for file: {}", path.toString());
try (final OutputStream outputStream = fileUtils.getOutputFile(path);
final Writer writer = new OutputStreamWriter(outputStream)) {
tmpl.process(response, writer);
}
}
Aggregations