ReverseCodeGenerator gen;
for (int i = 0; i < mappings.length; i++) {
if (_log.isInfoEnabled())
_log.info(_loc.get("class-code", mappings[i]));
ApplicationIdTool aid = newApplicationIdTool(mappings[i]);
if (getGenerateAnnotations())
gen = new AnnotatedCodeGenerator(mappings[i], aid);
else
gen = new ReverseCodeGenerator(mappings[i], aid);
gen.generateCode();
if (output == null) {
gen.writeCode();
written.add(gen.getFile());
if (aid != null && !aid.isInnerClass())
aid.record();
} else {
StringWriter writer = new StringWriter();
gen.writeCode(writer);
output.put(mappings[i].getDescribedType(), writer.toString());
if (aid != null && !aid.isInnerClass()) {
writer = new StringWriter();
aid.setWriter(writer);
aid.record();
output.put(mappings[i].getObjectIdType(),
writer.toString());
}
}
}