Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » [xtend ]Invoking Java from xtend
[xtend ]Invoking Java from xtend [message #777437] Tue, 10 January 2012 14:08 Go to next message
Peter Johnsen is currently offline Peter JohnsenFriend
Messages: 60
Registered: January 2012
Member
Hi all,

Can I use a class defined in a .java file from within xtend? Basically I would like to to this:

package p;

//X.java

class X {
  String op( String s ) { ... }
}


// X.xtend
import "p.X"

...
X x = new X()
x.op( "text" )


I did find something about jvmTypes, Xbase etc. in the reference documentation, but it didn't address my question.

[Updated on: Tue, 10 January 2012 14:09]

Report message to a moderator

Re: [xtend ]Invoking Java from xtend [message #777448 is a reply to message #777437] Tue, 10 January 2012 14:34 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
val x = new X()
x.op("Test")


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: [xtend ]Invoking Java from xtend [message #777457 is a reply to message #777448] Tue, 10 January 2012 14:52 Go to previous message
Peter Johnsen is currently offline Peter JohnsenFriend
Messages: 60
Registered: January 2012
Member
Aah...excellent! Thanks Christian! I have to say: the response time on this forum is outstanding! Smile
Previous Topic:[xtend] Import values
Next Topic:no autocompletion for QualifiedName
Goto Forum:
  


Current Time: Thu Apr 25 23:18:01 GMT 2024

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

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

Back to the top