|
Re: [Xtend] Lists in JAVA extensions [message #536732 is a reply to message #536729] |
Sun, 30 May 2010 14:40 |
|
Hello Hauke,
the extension / java class you defined looks ok and work in my hello world example.
The exception you get hints to some configuration / metamodel / classpath problem so please veryfy that the configuration is correct and that everything can be found on the classpath.
Regards, Christian
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
|
|
|
Re: [Xtend] Lists in JAVA extensions [message #536733 is a reply to message #536729] |
Sun, 30 May 2010 14:52 |
Gerd Kainz Messages: 23 Registered: May 2010 |
Junior Member |
|
|
Hi Hauke,
this might solve your problem.
Xtend:
List[Node] getPassedNodes(List[Node] nodes): JAVA javacode.Routing.getPassedNodes(java.util.List);
Java:
package javacode;
import org.eclipse.emf.common.util.BasicEList;
public class Routing {
public static List<Node> getPassedNodes(List<Node> nodes) {
List<Node> passedNodes;
passedNodes = new BasicEList<Node>();
passedNodes.addAll(nodes);
return passedNodes;
}
}
It's important that you specify the return type of your Xtend function even if you don't need to specify it for your Java method in Xtend.
As Alternative to BasicEList you can use any List implementation such as ArrayList.
Best regards,
Gerd
[Updated on: Sun, 30 May 2010 14:53] Report message to a moderator
|
|
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03760 seconds