Could someone please suggest how can I change default behaviour for “Start of user code” and “End user code” templates in Eclipse Lyo?
I mean is it possible to configure it somehow in order to make Lyo put these comments in those places I want? So that after code regeneration these places stay unchanged?
I tried to write these comments by my own in the places I want, but it just doesn’t work - they are overwritten.
At the same time I saw some projects in the internet (GitHub) and some custom comments were presented there so it seems to be working somehow.
These user code blocks are predefined and part of the code generation templates. It is not something you - as an end user of the generated code - can manually change.
So the ApplicationBinder is one of the newest classes, and it indeed lacks many use code blocks. To get started, just indicate where in the code you want to have them, and I can add them.
For you to get these changes, you will need to use the edge update site above.
@Override
protected void configure() {
log.info("HK2 contract binding start");
// Start of user code configure
bindAsContract(MyOwnUsefulClass.class).in(Singleton.class);
// End of user code
bindAsContract(RestDelegate.class).in(Singleton.class);
bindFactory(ResourcesFactoryFactory.class).to(ResourcesFactory.class).in(Singleton.class);
}