|
Re: EDate in the transformations [message #987684 is a reply to message #987586] |
Tue, 27 November 2012 15:22 |
Aran A Messages: 30 Registered: January 2011 |
Member |
|
|
Hi,
Sorry, I insist on this issue again, but I'm really stuck with it.
I haven't defined a custom or special EDate, I'm just using the Ecore data type. So, I understand that I don't have to rewrite the createXXXXFromString(EDataType eDataType, String initialValue) and convertXXXXToString(EDataType eDataType, Object instanceValue). That is for custom data types, isn't it?
With Strings I can define:
let aux: String = 'xxx' in ...
or
let aux: Sequence(String) = Sequence{'xx', 'zz'} in ...
So, with EDate I would like to do the same:
let aux: EDate = .... in ...
or
let aux: Sequence(EDate) = Sequence{....} in ...
Do I need something more in the ATL module specification? or what is that I am misunderstanding? I would appreciate any clue.
Thanks in advance,
|
|
|
Re: EDate in the transformations [message #987786 is a reply to message #987684] |
Wed, 28 November 2012 07:42 |
Ed Willink Messages: 7670 Registered: July 2009 |
Senior Member |
|
|
Hi
In so far as ATL follows the OCL specification, you cannot construct
DataType (or Class objects).
There have been a number of suggestions for object construction in OCL.
The new Pivot-based Eclipse OCL prototypes a solution re-using the Tuple
syntax: MyClass{name="myName} for classes and the Collection syntax
ecore::EDate{"20-Nov-2011"} for datatypes.
For now, I suspect that you may need Java helper functions.
Regards
Ed Willink
On 27/11/2012 15:23, Aran A wrote:
> Hi,
>
> Sorry, I insist on this issue again, but I'm really stuck with it.
> I haven't defined a custom or special EDate, I'm just using the Ecore
> data type. So, I understand that I don't have to rewrite the
> createXXXXFromString(EDataType eDataType, String initialValue) and
> convertXXXXToString(EDataType eDataType, Object instanceValue). That
> is for custom data types, isn't it?
>
> With Strings I can define:
>
> let aux: String = 'xxx' in ...
> or
> let aux: Sequence(String) = Sequence{'xx', 'zz'} in ...
>
> So, with EDate I would like to do the same:
>
> let aux: EDate = .... in ...
> or
> let aux: Sequence(EDate) = Sequence{....} in ...
>
> Do I need something more in the ATL module specification? or what is
> that I am misunderstanding? I would appreciate any clue.
>
> Thanks in advance,
>
|
|
|
|
Powered by
FUDForum. Page generated in 0.04264 seconds