| [news.eclipse.modeling.m2t] Re: [Xpand] Calling Java from Xpand |
RefuX schrieb:
My source model has GUIDs in it and as part of my transformation I need convert these GUIDs into int IDs. These int ids need to be consistent across conversions, i.e. GUID to ID needs to be the same across multiple runs.should be easy ... do something like this: ---------------------- a Java class: public class RelationshipService { public static int getID(String guid) { return 42; } } ---------------- a Xtend template: int getIdForGuid(String guid): JAVA your.package.RelationshipService.getID( java.lang.String); ---------- and now you can use xxx.getIdForGuid() as usual hope it helps ekke --
ekke (ekkehard gentz) |