*/
public void run() throws PstException {
List<PstException.TemplateException> exceptions = Lists.newArrayList();
for (File template : templates) {
try {
MessageProperties properties = createProperties(template);
String groupName = stripSuffix(".st", template.getName());
String templateName = properties.hasTemplateName() ?
properties.getTemplateName() : "";
StringTemplateGroup group = new StringTemplateGroup(groupName + "Group", dir(template));
StringTemplate st = group.getInstanceOf(groupName);
for (Descriptor messageDescriptor : fd.getMessageTypes()) {
Message message = new Message(messageDescriptor, templateName, properties);
st.reset();
st.setAttribute("m", message);
write(st, new File(
outputDir.getPath() + File.separator +
message.getFullJavaType().replace('.', File.separatorChar) + "." +
(properties.hasFileExtension() ? properties.getFileExtension() : "java")));
}
} catch (Exception e) {
exceptions.add(new PstException.TemplateException(template.getPath(), e));
}
}