final NewMethod newMethod = abstractMethod.copy(beanFactory);
newMethod.setAbstract(false);
newMethod.setFinal(true);
newMethod.setNative(false);
final RegisterFactoryBeansTemplatedFile body = new RegisterFactoryBeansTemplatedFile();
newMethod.setBody(body);
context.branch();
context.info("Overriding " + newMethod + " to register all beans.");
final Iterator<Bean> beansIterator = this.getBeans().values().iterator();
while (beansIterator.hasNext()) {
final Bean bean = beansIterator.next();
body.addBean(bean);
context.debug(bean.getId());
}
context.unbranch();
}