|
|
|
Re: Workflow [message #662493 is a reply to message #662375] |
Wed, 30 March 2011 20:13  |
|
It is only relevant that a name can be computed for the object. By default it is the 'name' attribute. If an object does not have a name attribute one could add a custom IQualifiedNameProvider and bind it to the runtime module. I often do this for the "Model" type and return the resource name as name.
import org.eclipse.xtext.naming.DefaultDeclarativeQualifiedNameProvider;
public class MyDslQualifiedNameProvider extends
DefaultDeclarativeQualifiedNameProvider {
String qualifiedName (final Model m) {
return m.eResource().getURI().lastSegment();
}
}
Registration in the runtime module:
public class MyDslRuntimeModule extends com.swissre.cs96.parsgen.sridl.AbstractMyDslRuntimeModule {
@Override
public Class<? extends IQualifiedNameProvider> bindIQualifiedNameProvider() {
return MyDslQualifiedNameProvider.class;
}
}
Then the "Model" objects get exported and they can be used as input for the generator in the workflow.
~Karsten
Need professional support for Xtext, EMF, Eclipse IDE?
Go to: http://devhub.karakun.com
Twitter : @kthoms
Blog : www.karsten-thoms.de
|
|
|
Powered by
FUDForum. Page generated in 0.01816 seconds