use of com.spectralogic.ds3autogen.go.models.type.Type in project ds3_autogen by SpectraLogic.
the class GoCodeGenerator method generateType.
/**
* Generates the response model represented by the specified {@link Ds3Type}
*/
private void generateType(final Ds3Type ds3Type) throws IOException, TemplateException {
final Template tmpl = getTypeTemplate(ds3Type);
final TypeModelGenerator<?> generator = getTypeGenerator(ds3Type);
final Type type = generator.generate(ds3Type);
final Path path = destDir.resolve(BASE_PROJECT_PATH.resolve(Paths.get(COMMANDS_NAMESPACE.replace(".", "/") + "/" + uncapitalize(type.getName()) + ".go")));
LOG.info("Getting OutputStream for file: {}", path.toString());
try (final OutputStream outputStream = fileUtils.getOutputFile(path);
final Writer writer = new OutputStreamWriter(outputStream)) {
tmpl.process(type, writer);
}
}
Aggregations