[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Newsgroup Home]
|
[news.eclipse.modeling.m2t] Re: Dynamically call another xtend method from current xtend method
|
Hi Joerg,
sorry for the late response. It is actualle not possible to dynamically
invoke extensions. Neither the name of an extension may be an expression
nor the refered extension file may be calculated at runtime. As far as I
know, there is no workaround.
Please feel free to file a bugzilla.
Maybe there is one rather tricky way to do what you want.
The ResourceLoader is the class, that should resolve a given path to an
input stream. Maybe you can use an own implementation and register it at
the ResourceLoaderFactory. Your ResourceLoader could be configured based
on your source model _before_ you invoke the transformation. I'm not
that sure about it but this may work.
Regards,
Sebastian
--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com
Joerg Reichert schrieb:
Is it possible to dynamically call a Xtend method in another file from
the current Xtend file? The path of the method to call is dynamically
calculated at runtime in the first extension file. It's like a need for
reflection for Xtend.
Use Case:
provided
- source model
- transformation description model containing the paths to the extension
files
- target model - a list of extension files having the same name and the
same named methods just differ in the directory location (so the
solution to import all possible to use extensions won't work)
runtime
At runtime it is determined on basis of the source model which paths are
read out from the transformation model, defining the xtend file and the
method to call. The context of the current xtend method should be also
available for the called extension.