|
Re: [xtend2] access static member in another package [message #786427 is a reply to message #786377] |
Mon, 30 January 2012 12:07 |
Sebastian Zarnekow Messages: 3118 Registered: July 2009 |
Senior Member |
|
|
Hi Bruce,
val foo = my::very::long::package::Class::IamStatic()
should work.
Regards,
Sebastian
--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com
Am 30.01.12 11:46, schrieb Bruce L.:
> Hello all,
>
> in xtend2, I can write something like this
>
> val foo = new my.very.long.package.Class()
>
>
> But if a try to access a static member the editor complains. That is, I
> cannot write something like this
>
> val foo = my.very.long.package.Class::IamStatic()
>
>
> Where Class is either a Java class or an xtend2 class, and the current
> class is in another package, of course.
> So, how can I access a static member of a class contained in another
> package?
>
> I do not want (or cannot) import the class and then simply use
> Class::IamStatic()
> because I need to keep the "namespace" explicit in the code to avoid
> confusion. Moreover, I might be inside a class whose name is again
> 'Class', an so without package specification I cannot tell the compiler
> to use the class in the other package.
>
> thanks
> B
|
|
|
|
Powered by
FUDForum. Page generated in 0.03576 seconds