private void generateSourceFile(FactoryModel model) {
try {
String factoryName = model.declaration.getQualifiedName() + "Impl";
JavaFileObject src = filer.createSourceFile(factoryName, model.declaration);
PrintWriter writer = new PrintWriter(src.openWriter());
writer.println(formatter.generate(model));
writer.flush();
writer.close();
} catch (IOException e) {
messager.printMessage(Kind.ERROR, e.getMessage(), model.declaration);