Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » Use Java ENUM from eol
Use Java ENUM from eol [message #1411478] Sat, 23 August 2014 12:56 Go to next message
Eclipse GuestFriend
Messages: 93
Registered: February 2013
Location: Vienna
Member
Hi,

I want to enable our e*l scripts to use an existing logger doing something like this:

var logger = new Native("com.something.MdeLogger")("com.something.ImporterAidaMain.class");
var level = Native("org.apache.log4j.Level");
logger.writeDebugMsg(level#DEBUG, "in PRE");


MdeLogger has a method writeDebug with the following signature:

public void writeDebugMsg(Level lvl, Object msg)


Should the Enum value of Level be accessed in a different way? I am getting the following exception:

EXCEPTION: Cannot find enumeration literal level#DEBUG in model "modelName".

I am afraid I am missing something obvious here so any ideas are very welcome!

Cheers!
-Jan
Re: Use Java ENUM from eol [message #1412108 is a reply to message #1411478] Mon, 25 August 2014 10:03 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 2165
Registered: July 2009
Location: York, UK
Senior Member

Hi Jan,

I don't think EOL supports Java enumerations. Could you please file an enhacncement request for this?

https://bugs.eclipse.org/bugs/enter_bug.cgi?product=epsilon

One workaround would be to wrap your logger in a native Java tool [1] the methods of which don't make use of enumerations.

Cheers,
Dimitris

[1] https://www.eclipse.org/epsilon/doc/articles/call-java-from-epsilon/
Re: Use Java ENUM from eol [message #1412450 is a reply to message #1412108] Tue, 26 August 2014 07:37 Go to previous message
Jan Schumacher is currently offline Jan SchumacherFriend
Messages: 3
Registered: August 2014
Junior Member
Hi Dimitris,

enhancement request is filed and I resolved my issue using wrapping.

Thanks for guiding me in the right direction. Smile
-J
Previous Topic:[EUnit] ignore attributes in models comparison
Next Topic:[EMF Model] XMI namespace URI
Goto Forum:
  


Current Time: Sat Apr 27 01:33:34 GMT 2024

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

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

Back to the top