I am trying to use Papyrus and Acceleo to generate code. But I am facing a problem with attributes' types. I want to generate a java.util.Date attribute but all I can find is an EDate. Same thing with any other type which is not a primitive type.
The instanceTypeName of EDate is java.util.Date so you may be creating a
problem where none exists.
But since you don't give any details, only you can know.
Regards
Ed Willink
On 07/10/2012 21:35, Crush Mach wrote:
> Hi,
> I am trying to use Papyrus and Acceleo to generate code. But I am
> facing a problem with attributes' types. I want to generate a
> java.util.Date attribute but all I can find is an EDate. Same thing
> with any other type which is not a primitive type.
>
> Any idea how I can resolve this?
Thx Ed for your reply,
I understand that. My problem is that I have to generate a specific java code from my class diagram and it has to have Date, Long ...as types, and not EDate
So what's the problem? An Acceleo template is very capable of using the
instanceTypeName of an EDataType.
Regards
Ed Willink
On 07/10/2012 23:07, Crush Mach wrote:
> Thx Ed for your reply, I understand that. My problem is that I have to
> generate a specific java code from my class diagram and it has to have
> Date, Long ...as types, and not EDate
You probably need to define a UML DataType in your model (e.g. create a new DataType named "Date"). Then you use this datatype to type your UML properties.
In your acceleo template, simply generate a java.util.Date object each time you have a property typed with your UML DataType named "Date". Thus, you won't need to use the Ecore EDataType/EDate elements.