|Re: is there a way to ignore an EPackage during the java code generation ? [message #1759106 is a reply to message #1759053]
||Thu, 06 April 2017 13:31
|| vincent lorenzo
Registered: June 2010
Location: Paris Saclay, France
Hi Ed, thank you for your answer. |
I think I must give you more details on my usecase, because I tried this solution and it didn't work.
I'm doing these things : Papyrus UML Model -> Ecore Model -> java code.
In my Papyrus Model, I have :
- a PrimitiveType mapped on java.lang.Boolean (stereotyped as EDataType)
- a class representing EClass (stereotyped as EClass)
- a class representing EObject (stereotyped as EClass)
Of course these objects are used to types UML Properties
The UML to EMF tool creates an EDatatype and 2 EClasses adressing the real object.
The code generation works fine. (there are no code generated for boolean, EClass and EObject !)
Now, I would like to group these objects in a dedicated Package (or a dedicated model). I do a simple model (in attachment ) to apply your answer.
As the objects in this package are used as type in the second model, the generated code for xxxPackageImpl#init() doesn't compile because we initialize the useless dependency to the package I didn't generate
In attachment a simple example to reproduce my problem in EMF pure.
Thank you for your help.
Of course, I could avoid headache using EBooleanObject, EClass and EObject instead of creating EDatatype and EClass to represent them, but this is the current result of the UMLToEcore transformation so I would like to know if it is possible to not reference a not generated package when it contains only predefined types.
(Size: 24.35KB, Downloaded 42 times)
Powered by FUDForum
. Page generated in 0.02088 seconds