Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [ATL] : How to deal with BigInteger Datatype
[ATL] : How to deal with BigInteger Datatype [message #84575] Mon, 16 June 2008 12:54 Go to next message
Eclipse UserFriend
Originally posted by: amehmood.sophia.inria.fr

Hi All,

I have got an attribute in my automatically generated Metamodel, to be of
type NonNegativeInteger (or 'class java.math.BigInteger').

Now I try to assign some value to it but it gives me the errors like
Ingeter can't be mapped to BigInteger. See it:

SEVERE: ****** BEGIN Stack Trace
SEVERE: message: cannot set feature myML!BDefType.maxMasters to value 5
SEVERE: exception:
SEVERE: The value of type 'class java.lang.Integer' must be of type 'class
java.math.BigInteger'
java.lang.ClassCastException: The value of type 'class java.lang.Integer'
must be of type 'class java.math.BigInteger'


I can't even assign it value directly. Is there any other method to give
values to such datatypes or ATL doesn't support them all. what abt the
setRefValue() function?

Will be waiting for suggestions,

Regards,
-aamir-
Re: [ATL] : How to deal with BigInteger Datatype [message #84648 is a reply to message #84575] Mon, 16 June 2008 13:01 Go to previous messageGo to next message
urs zeidler is currently offline urs zeidlerFriend
Messages: 91
Registered: July 2009
Member
You can set such a value, the ATL engine supports only basic types (int,
string boolean etc.) for datatypes, at least I know. This is quite a
limitation, perhaps you open up a feature request for it.

greetings, urs.
Re: [ATL] : How to deal with BigInteger Datatype [message #84659 is a reply to message #84648] Mon, 16 June 2008 13:38 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: amehmood.sophia.inria.fr

You said that I can set such a value, How? have u got any example? Using
setValueRef() or anything else? I mean for now I only want the solution,
have u got any solution at all? (No matter how odd it is), other than
waiting for the next release of ATL....:)

Hope to hear u soon urs,

thanks alot,
-aamir-

urs zeidler wrote:

> You can set such a value, the ATL engine supports only basic types (int,
> string boolean etc.) for datatypes, at least I know. This is quite a
> limitation, perhaps you open up a feature request for it.

> greetings, urs.
Re: [ATL] : How to deal with BigInteger Datatype [message #84671 is a reply to message #84659] Mon, 16 June 2008 13:55 Go to previous messageGo to next message
urs zeidler is currently offline urs zeidlerFriend
Messages: 91
Registered: July 2009
Member
Aamir schrieb:
>
> You said that I can set such a value, How? have u got any example? Using
> setValueRef() or anything else? I mean for now I only want the solution,
> have u got any solution at all? (No matter how odd it is), other than
> waiting for the next release of ATL....:)
>
> Hope to hear u soon urs,
>
> thanks alot,
> -aamir-
>
> urs zeidler wrote:
>
>> You can set such a value, the ATL engine supports only basic types
>> (int, string boolean etc.) for datatypes, at least I know. This is
>> quite a limitation, perhaps you open up a feature request for it.
>
>> greetings, urs.
>
>
this was a typo, I meant can't, sorry for that.
Re: [ATL] : How to deal with BigInteger Datatype [message #84717 is a reply to message #84671] Wed, 18 June 2008 13:23 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: huascar.espinoza.cea.fr

Aamir,

You have to change your non-java data types into java types (in your
metamodel), and validate it in your ATL code. For example,
NonNegativeInteger should be controlled to be positive in your ATL code.

Cheers,

Huascar

"urs zeidler" <ich@urszeidler.de> a
Re: [ATL] : How to deal with BigInteger Datatype [message #84729 is a reply to message #84717] Wed, 18 June 2008 13:42 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: amehmood.sophia.inria.fr

Can you be more explicit. Two things u state in ur mail.

To change the metamodel, I already said an "automatically generated
metamodel" so I m unable to change it and even if I am able to do so, who
will be doing it for 100+ attributes and that also, each time a new
version is released !!!

I couldn't grab ur second point correctly. do u want to say that I must
beware of the wrong values assigned, through the code? But my code error
clearly says:

SEVERE: message: cannot set feature myML!BDefType.maxMasters to value 5
SEVERE: exception: SEVERE: The value of type 'class java.lang.Integer'
must be of type 'class java.math.BigInteger'

so, the error is not due to that. May be u mean something else! I just
long some way, maybe to convert my value '5' to bigInteger and then pass
it. I mean, in all terms the BigInteger is the superset of Integer, then
why not be compatible???

Thanks for the reply and hope to see ur comments soon.

Ciao,

-aamir-



Huascar Espinoza wrote:

> Aamir,

> You have to change your non-java data types into java types (in your
> metamodel), and validate it in your ATL code. For example,
> NonNegativeInteger should be controlled to be positive in your ATL code.

> Cheers,

> Huascar
Re: [ATL] : How to deal with BigInteger Datatype [message #87974 is a reply to message #84729] Mon, 11 August 2008 10:20 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: kachd.web.de

Hello!

Does anyone have a solution for this problem? I want to assign a value
to my output model, but as it seems to be of the type
"Java.math.BigInteger", I always get error messages like this one:

"Caused by: java.lang.ClassCastException: The value of type 'class
java.lang.Integer' must be of type 'class java.math.BigInteger'"

Aamir seems to have had the same problem, have you got any solution?
Does ATL support BigIntegers now? Is there a simple way to transform
Integers or Strings to BigIntegers?

I hope, someone answers,

Manu

Aamir schrieb:
> Can you be more explicit. Two things u state in ur mail.
> To change the metamodel, I already said an "automatically generated
> metamodel" so I m unable to change it and even if I am able to do so,
> who will be doing it for 100+ attributes and that also, each time a new
> version is released !!!
>
> I couldn't grab ur second point correctly. do u want to say that I must
> beware of the wrong values assigned, through the code? But my code error
> clearly says:
>
> SEVERE: message: cannot set feature myML!BDefType.maxMasters to value 5
> SEVERE: exception: SEVERE: The value of type 'class
> java.lang.Integer' must be of type 'class java.math.BigInteger'
>
> so, the error is not due to that. May be u mean something else! I just
> long some way, maybe to convert my value '5' to bigInteger and then pass
> it. I mean, in all terms the BigInteger is the superset of Integer, then
> why not be compatible???
>
> Thanks for the reply and hope to see ur comments soon.
>
> Ciao,
>
> -aamir-
>
>
>
> Huascar Espinoza wrote:
>
>> Aamir,
>
>> You have to change your non-java data types into java types (in your
>> metamodel), and validate it in your ATL code. For example,
>> NonNegativeInteger should be controlled to be positive in your ATL code.
>
>> Cheers,
>
>> Huascar
>
>
Re: [ATL] : How to deal with BigInteger Datatype [message #88024 is a reply to message #87974] Mon, 11 August 2008 12:48 Go to previous message
William Piers is currently offline William PiersFriend
Messages: 301
Registered: July 2009
Senior Member
Hello,

There is at this time no way to set those types in ATL.
We are studying the possibility to provide a core extensibility for this
issue, in order to easily allow users to define theyre own types adapters.

For the moment, you can use the old way (quite hard but possible),
referring to that use case :
http://www.eclipse.org/m2m/atl/usecases/UML2AnyLogic/
In it you will find a custom model handler which allows the use of
specific data types.

Best regards,

William

Arnd a écrit :
> Hello!
>
> Does anyone have a solution for this problem? I want to assign a value
> to my output model, but as it seems to be of the type
> "Java.math.BigInteger", I always get error messages like this one:
>
> "Caused by: java.lang.ClassCastException: The value of type 'class
> java.lang.Integer' must be of type 'class java.math.BigInteger'"
>
> Aamir seems to have had the same problem, have you got any solution?
> Does ATL support BigIntegers now? Is there a simple way to transform
> Integers or Strings to BigIntegers?
>
> I hope, someone answers,
>
> Manu
>
> Aamir schrieb:
>> Can you be more explicit. Two things u state in ur mail.
>> To change the metamodel, I already said an "automatically generated
>> metamodel" so I m unable to change it and even if I am able to do so,
>> who will be doing it for 100+ attributes and that also, each time a
>> new version is released !!!
>>
>> I couldn't grab ur second point correctly. do u want to say that I
>> must beware of the wrong values assigned, through the code? But my
>> code error clearly says:
>>
>> SEVERE: message: cannot set feature myML!BDefType.maxMasters to
>> value 5
>> SEVERE: exception: SEVERE: The value of type 'class
>> java.lang.Integer' must be of type 'class java.math.BigInteger'
>>
>> so, the error is not due to that. May be u mean something else! I just
>> long some way, maybe to convert my value '5' to bigInteger and then
>> pass it. I mean, in all terms the BigInteger is the superset of
>> Integer, then why not be compatible???
>>
>> Thanks for the reply and hope to see ur comments soon.
>>
>> Ciao,
>>
>> -aamir-
>>
>>
>>
>> Huascar Espinoza wrote:
>>
>>> Aamir,
>>
>>> You have to change your non-java data types into java types (in your
>>> metamodel), and validate it in your ATL code. For example,
>>> NonNegativeInteger should be controlled to be positive in your ATL code.
>>
>>> Cheers,
>>
>>> Huascar
>>
>>
Previous Topic:ATL: Problems working with BigInteger
Next Topic:[QVTO] Unit testing
Goto Forum:
  


Current Time: Tue Apr 23 16:15:27 GMT 2024

Powered by FUDForum. Page generated in 0.03415 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top