String comments = this.getComments();
final String date = DateFormat.getInstance().format(new Date());
final String generatorName = this.getGeneratorContext().getGenerator().getClass().getName();
comments = comments + "\n\nGenerated at " + date + " by " + generatorName;
final MetaData metaData = this.getMetaData();
final StringBufferSourceWriter writer = new StringBufferSourceWriter();
while (true) {
final boolean noComments = Tester.isNullOrEmpty(comments);
final boolean noAnnotations = metaData.isEmpty();
if (noComments && noAnnotations) {
break;
}
// only has annotations...
if (noComments && false == noAnnotations) {
metaData.write(writer);
break;
}
// only has comments...
if (noComments && false == noAnnotations) {
writer.println(comments);
break;
}
// must have both annotations and comments...
writer.println(comments);
writer.println();
metaData.write(writer);
break;
}
composerFactory.setJavaDocCommentForClass(writer.getBuffer().toString());
}