Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » [xtend2] import static inner Java classes
[xtend2] import static inner Java classes [message #755657] Wed, 09 November 2011 08:46 Go to next message
Hauke Fuhrmann is currently offline Hauke FuhrmannFriend
Messages: 333
Registered: July 2009
Senior Member
Hi there,

what's the syntax to access static inner Java classes in xtend2?
Does xtend support inner classes or do I have to wrap the inner class in
a normal class or something like that?

Rationale: I want to use EcoreUtil.UsageCrossReferencer in Xtend.

Cheers,
Hauke
Re: [xtend2] import static inner Java classes [message #755687 is a reply to message #755657] Wed, 09 November 2011 10:13 Go to previous messageGo to next message
Jan Koehnlein is currently offline Jan KoehnleinFriend
Messages: 760
Registered: July 2009
Location: Hamburg
Senior Member
Static member access works with '::'
EcoreUtil::UsageCrossReferencer
System::out::println()


Am 09.11.11 09:46, schrieb Hauke Fuhrmann:
> Hi there,
>
> what's the syntax to access static inner Java classes in xtend2?
> Does xtend support inner classes or do I have to wrap the inner class in
> a normal class or something like that?
>
> Rationale: I want to use EcoreUtil.UsageCrossReferencer in Xtend.
>
> Cheers,
> Hauke


--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com


---
Get professional support from the Xtext committers at www.typefox.io
Re: [xtend2] import static inner Java classes [message #755688 is a reply to message #755687] Wed, 09 November 2011 10:17 Go to previous messageGo to next message
Jan Koehnlein is currently offline Jan KoehnleinFriend
Messages: 760
Registered: July 2009
Location: Hamburg
Senior Member
Oh sorry, of course println() is not static, so it's
System::out.println

Am 09.11.11 11:13, schrieb Jan Koehnlein:
> Static member access works with '::'
> EcoreUtil::UsageCrossReferencer
> System::out::println()
>
>
> Am 09.11.11 09:46, schrieb Hauke Fuhrmann:
>> Hi there,
>>
>> what's the syntax to access static inner Java classes in xtend2?
>> Does xtend support inner classes or do I have to wrap the inner class in
>> a normal class or something like that?
>>
>> Rationale: I want to use EcoreUtil.UsageCrossReferencer in Xtend.
>>
>> Cheers,
>> Hauke
>
>


--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com


---
Get professional support from the Xtext committers at www.typefox.io
Re: [xtend2] import static inner Java classes [message #757877 is a reply to message #755687] Wed, 16 November 2011 13:44 Go to previous messageGo to next message
Hauke Fuhrmann is currently offline Hauke FuhrmannFriend
Messages: 333
Registered: July 2009
Senior Member
Hi Jan,

thanks, but I was *not* referring to static *members*, but static
*inner classes* like this in Java:

class MyClass{
static final class MyInnerClass{
}
}

In Xtend2 I now want to use MyInnerClass as a parameter for example.

def function(MyInnerClass it){
return it
}

I don't find any valid import syntax for this, like

import base.MyClass.MyInnerClass
or
import base.MyClass::MyInnerClass

In Java the first one works, in Xtend not.
Any clue? Is this not supported?

Cheers,
Hauke

Am 09.11.2011 11:13, schrieb Jan Koehnlein:
> Static member access works with '::'
> EcoreUtil::UsageCrossReferencer
> System::out::println()
>
>
> Am 09.11.11 09:46, schrieb Hauke Fuhrmann:
>> Hi there,
>>
>> what's the syntax to access static inner Java classes in xtend2?
>> Does xtend support inner classes or do I have to wrap the inner class in
>> a normal class or something like that?
>>
>> Rationale: I want to use EcoreUtil.UsageCrossReferencer in Xtend.
>>
>> Cheers,
>> Hauke
>
>
Re: [xtend2] import static inner Java classes [message #757878 is a reply to message #757877] Wed, 16 November 2011 17:06 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13409
Registered: July 2009
Senior Member
Outer$Inner might work. Regards Christian

Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/xtext/
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: [xtend2] import static inner Java classes [message #757880 is a reply to message #757878] Thu, 17 November 2011 12:43 Go to previous message
Hauke Fuhrmann is currently offline Hauke FuhrmannFriend
Messages: 333
Registered: July 2009
Senior Member
Am 16.11.2011 18:06, schrieb Christian Dietrich:
> Outer$Inner might work. Regards Christian

Yap, that works, thanks.

Hauke
Previous Topic:entity cross references in domainmodel
Next Topic:add external jar in xtext ui folder
Goto Forum:
  


Current Time: Sun Mar 29 19:56:21 GMT 2020

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

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

Back to the top