JavaSourceFactory factory = new JavaSourceFactory();
factory.setOverwriteForced(true);
// Let the factory create a Java source class
// "com.mycompany.demo.Parser"
JavaQName className = getBusinessInformer(sourceClass.getQName());
JavaSource js = factory.newJavaSource(className, "public");
JavaComment comment = js.newComment();
comment.addLine("");
comment.addLine("Define improved Informer for "+sourceClass.getClassName()+".");
comment.addLine("Elements of this method allows easier usage of improved gaedo finders.");
comment.addLine("The instances of FieldInformer used for that class various fields have been chosen according to FieldInformerLocator current implementation.");
comment.addLine("As a consequence, the behaviour of this method has guaranteed comaptibilty with most of gaedo code");
comment.addLine("");
comment.addLine("@see "+sourceClass.getQName().toString());
comment.addSee(JavaQNameImpl.getInstance(FieldInformer.class).toString());
comment.addSee(JavaQNameImpl.getInstance(FieldInformerLocator.class).toString());
comment.addAuthor("created by gaedo-informer generator on "+format.format(new Date()));
js.setDynamicImports(true);
js.setType(js.INTERFACE);
js.setProtection(js.PUBLIC);
js.addExtends(Informer.class);
JavaField[] fields = sourceClass.getFields();
for(JavaField f : fields) {
if(isWritable(f))
createDeclaration(js, sourceClass, f);
}