Community
Participate
Working Groups
With the support for bug 402781 we don't need the default EMF factory methods to be API. They should be marked as @noreference. PW
No I have opened a BR I actually did not want :-) What is the motivation to hide the factories, especially the create methods?
(In reply to comment #1) > No I have opened a BR I actually did not want :-) > What is the motivation to hide the factories, especially the create methods? The goal in for the model interface is to be independent of its implementation. The factory create methods 'leak' the fact we are using EMF to implement it.
Rene, any idea how to implement that?
(In reply to Lars Vogel from comment #3) > Rene, any idea how to implement that? I think a custom EMF-JavaJet-Template for factories would solve the problem easily. Copy the "org.eclipse.emf.codegen.ecore/templates/model/FactoryClass.javajet" template to the E4-model modify it (add the annotation to the correct place) and afterwards reference the template in the corresponding *.genmodel files. If we don't care about the exact location of the "@noreference"-JavaDoc entry (means can be in the middle of the JavaDoc and not at the end), we could maybe use some already existing EMF-GenModel-Annotation to enrich it.
(In reply to René Brandstetter from comment #4) > (In reply to Lars Vogel from comment #3) > > Rene, any idea how to implement that? > > I think a custom EMF-JavaJet-Template for factories would solve the problem > easily. Copy the > "org.eclipse.emf.codegen.ecore/templates/model/FactoryClass.javajet" > template to the E4-model modify it (add the annotation to the correct place) > and afterwards reference the template in the corresponding *.genmodel files. > > If we don't care about the exact location of the "@noreference"-JavaDoc > entry (means can be in the middle of the JavaDoc and not at the end), we > could maybe use some already existing EMF-GenModel-Annotation to enrich it. Thanks Rene, that sounds a bit complex for such a simple task. I add Ed to the bug, he may be able to guide us here.
You can add anything to the "user-doc" section * <!-- begin-user-doc --> * <!-- end-user-doc --> JMerge preserves those contents. If you remove the section markers (but leave the @generated so that the interface body itself is still regenerated) JMerge will leave the entire Javadoc comment untouched. So I don't see a need for a specialized template...
(In reply to Ed Merks from comment #6) > You can add anything to the "user-doc" section > > * <!-- begin-user-doc --> > * <!-- end-user-doc --> > > JMerge preserves those contents. If you remove the section markers (but > leave the @generated so that the interface body itself is still regenerated) > JMerge will leave the entire Javadoc comment untouched. So I don't see a > need for a specialized template... I always thought that the GenModel-Annotation detail "documentation" was required to bring custom content into the JavaDoc part, but that are great news to hear (makes things easier). The only problem is a complete new generation of the model/factory/..., in this case the information will be gone, but I guess/hope nobody will ever do this.
Thanks Ed ! Rene, feel free to make a Gerrit patch based on this info...
I know I opened this, but it looks like marking these as @noreference now would be an API change. Dani, that would make this a no-go, right? PW
I think we'll just have to live with it. If anybody has any suggestions, I'm open to them. PW