FileSystem.getResource(template.getTemplateFile()),
mergeModels(sharedModel, indivModel)
);
if (template.getTransformers() != null) {
CodeByLine codeLines = CodeByLine.fromString(output);
for (String transformerId: template.getTransformers()) {
if (codeTransformers.containsKey(transformerId)) {
codeLines = codeTransformers.get(transformerId).transform(codeLines);
}
else {
talkingWindow.indent();
talkingWindow.error("Unknown transformer \"" + transformerId + "\"");
talkingWindow.unindent();
}
}
output = codeLines.toString();
}
} catch (FileNotFoundException e) {
// Fatal error, the existence has been checked before
Log.e("Fatal error, cannot find resource " + template.getTemplateFile(), e);
throw new IllegalStateException(e);