Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » [eol] problem with creating a native java String
[eol] problem with creating a native java String [message #545037] Tue, 06 July 2010 13:44 Go to next message
m kranz is currently offline m kranzFriend
Messages: 69
Registered: January 2010
Member
hi all

i was trying to create a java.lang.String as native type in eol (as shown in the book, listing 3.8 ), but it does not seem to work. i tried things like the following, but it always tells me that the methods (replaceAll, indexOf etc.) are not found.

var code = new Native("java.lang.String");
code.replaceAll("", node.viewmap.classBody.toString());
var index = code.indexOf("createContents()");

has anyone an idea what i'm doing wrong?

thanks

marco
Re: [eol] problem with creating a native java String [message #545062 is a reply to message #545037] Tue, 06 July 2010 14:36 Go to previous messageGo to next message
Dimitrios Kolovos is currently offline Dimitrios KolovosFriend
Messages: 1776
Registered: July 2009
Senior Member
Hi Marco,

In the current version of Epsilon all instances of java.lang.String are
wrapped as instances of EolString. However, we've now removed all
wrapping and will be releasing a new interim version shortly (within the
next couple of hours) in which you can call all native functions as
well. I'll let you know when it's ready.

Cheers,
Dimitris

mkranz wrote:
> hi all
>
> i was trying to create a java.lang.String as native type in eol (as
> shown in the book, listing 3.8 ), but it does not seem to work. i tried
> things like the following, but it always tells me that the methods
> (replaceAll, indexOf etc.) are not found.
>
> var code = new Native("java.lang.String");
> code.replaceAll("", node.viewmap.classBody.toString());
> var index = code.indexOf("createContents()");
>
> has anyone an idea what i'm doing wrong?
>
> thanks
>
> marco
Re: [eol] problem with creating a native java String [message #545079 is a reply to message #545062] Tue, 06 July 2010 14:58 Go to previous messageGo to next message
m kranz is currently offline m kranzFriend
Messages: 69
Registered: January 2010
Member
hello dimitris

sounds great! but i still have to use a native java string, right?
oh and btw., how's assignment handled with native strings?
can i do this?

var string = new Native("java.lang.String");
string = "bla";


cheers

marco
Re: [eol] problem with creating a native java String [message #545097 is a reply to message #545079] Tue, 06 July 2010 15:35 Go to previous messageGo to next message
Dimitrios Kolovos is currently offline Dimitrios KolovosFriend
Messages: 1776
Registered: July 2009
Senior Member
Hi Marco,

In the new version you won't have to use Native(...) to define a native
String as all strings will be native. var a : String; will create a new
native string and then you can perform the assignment using = (i.e. a =
"bla";).

Cheers,
Dimitris

mkranz wrote:
> hello dimitris
>
> sounds great! but i still have to use a native java string, right?
> oh and btw., how's assignment handled with native strings?
> can i do this?
>
> var string = new Native("java.lang.String");
> string = "bla";
>
>
> cheers
>
> marco
Re: [eol] problem with creating a native java String [message #545105 is a reply to message #545097] Tue, 06 July 2010 16:04 Go to previous message
Dimitrios Kolovos is currently offline Dimitrios KolovosFriend
Messages: 1776
Registered: July 2009
Senior Member
Hi Marco,

The new version is now available in the interim update site:
http://download.eclipse.org/modeling/gmt/epsilon/interim/

Please note that we have heavily refactored some of the core parts of
Epsilon in this version and although all our tests are green, new bugs
may still have found their way in, so I'd recommend trying this in a new
Eclipse instance - just in case.

Cheers,
Dimitris

Dimitris Kolovos wrote:
> Hi Marco,
>
> In the new version you won't have to use Native(...) to define a native
> String as all strings will be native. var a : String; will create a new
> native string and then you can perform the assignment using = (i.e. a =
> "bla";).
>
> Cheers,
> Dimitris
>
> mkranz wrote:
>> hello dimitris
>>
>> sounds great! but i still have to use a native java string, right?
>> oh and btw., how's assignment handled with native strings?
>> can i do this?
>>
>> var string = new Native("java.lang.String");
>> string = "bla";
>>
>>
>> cheers
>>
>> marco
Re: [eol] problem with creating a native java String [message #590471 is a reply to message #545037] Tue, 06 July 2010 14:36 Go to previous message
Dimitrios Kolovos is currently offline Dimitrios KolovosFriend
Messages: 1776
Registered: July 2009
Senior Member
Hi Marco,

In the current version of Epsilon all instances of java.lang.String are
wrapped as instances of EolString. However, we've now removed all
wrapping and will be releasing a new interim version shortly (within the
next couple of hours) in which you can call all native functions as
well. I'll let you know when it's ready.

Cheers,
Dimitris

mkranz wrote:
> hi all
>
> i was trying to create a java.lang.String as native type in eol (as
> shown in the book, listing 3.8 ), but it does not seem to work. i tried
> things like the following, but it always tells me that the methods
> (replaceAll, indexOf etc.) are not found.
>
> var code = new Native("java.lang.String");
> code.replaceAll("", node.viewmap.classBody.toString());
> var index = code.indexOf("createContents()");
>
> has anyone an idea what i'm doing wrong?
>
> thanks
>
> marco
Re: [eol] problem with creating a native java String [message #590482 is a reply to message #545062] Tue, 06 July 2010 14:58 Go to previous message
m kranz is currently offline m kranzFriend
Messages: 69
Registered: January 2010
Member
hello dimitris

sounds great! but i still have to use a native java string, right?
oh and btw., how's assignment handled with native strings?
can i do this?

var string = new Native("java.lang.String");
string = "bla";


cheers

marco
Re: [eol] problem with creating a native java String [message #590491 is a reply to message #545079] Tue, 06 July 2010 15:35 Go to previous message
Dimitrios Kolovos is currently offline Dimitrios KolovosFriend
Messages: 1776
Registered: July 2009
Senior Member
Hi Marco,

In the new version you won't have to use Native(...) to define a native
String as all strings will be native. var a : String; will create a new
native string and then you can perform the assignment using = (i.e. a =
"bla";).

Cheers,
Dimitris

mkranz wrote:
> hello dimitris
>
> sounds great! but i still have to use a native java string, right?
> oh and btw., how's assignment handled with native strings?
> can i do this?
>
> var string = new Native("java.lang.String");
> string = "bla";
>
>
> cheers
>
> marco
Re: [eol] problem with creating a native java String [message #590501 is a reply to message #545097] Tue, 06 July 2010 16:04 Go to previous message
Dimitrios Kolovos is currently offline Dimitrios KolovosFriend
Messages: 1776
Registered: July 2009
Senior Member
Hi Marco,

The new version is now available in the interim update site:
http://download.eclipse.org/modeling/gmt/epsilon/interim/

Please note that we have heavily refactored some of the core parts of
Epsilon in this version and although all our tests are green, new bugs
may still have found their way in, so I'd recommend trying this in a new
Eclipse instance - just in case.

Cheers,
Dimitris

Dimitris Kolovos wrote:
> Hi Marco,
>
> In the new version you won't have to use Native(...) to define a native
> String as all strings will be native. var a : String; will create a new
> native string and then you can perform the assignment using = (i.e. a =
> "bla";).
>
> Cheers,
> Dimitris
>
> mkranz wrote:
>> hello dimitris
>>
>> sounds great! but i still have to use a native java string, right?
>> oh and btw., how's assignment handled with native strings?
>> can i do this?
>>
>> var string = new Native("java.lang.String");
>> string = "bla";
>>
>>
>> cheers
>>
>> marco
Previous Topic:[eol] problem with creating a native java String
Next Topic:Accessing MapInfo structure from ECL
Goto Forum:
  


Current Time: Fri Apr 19 10:39:22 GMT 2024

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

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

Back to the top