33 lines
1.2 KiB
Plaintext
33 lines
1.2 KiB
Plaintext
|
package com.minres.coredsl.json
|
||
|
|
||
|
import com.google.inject.Binder
|
||
|
import com.google.inject.Provider
|
||
|
import com.minres.coredsl.CoreDslRuntimeModule
|
||
|
import org.eclipse.xtext.generator.IFileSystemAccess2
|
||
|
import org.eclipse.xtext.generator.IGenerator2
|
||
|
import org.eclipse.xtext.generator.JavaIoFileSystemAccess
|
||
|
import org.eclipse.xtext.generator.IOutputConfigurationProvider
|
||
|
import javax.inject.Singleton
|
||
|
import com.minres.coredsl.json.GeneratorOutputConfigurationProvider
|
||
|
|
||
|
/**
|
||
|
* Use this class to register components to be used at runtime / without the Equinox extension registry.
|
||
|
*/
|
||
|
@SuppressWarnings("all") class CoreDslGeneratorModule extends CoreDslRuntimeModule {
|
||
|
override void configure(Binder binder) {
|
||
|
super.configure(binder);
|
||
|
//binder.bind(TemplateEngine).to(SimpleTemplateEngine);
|
||
|
binder.bind(IOutputConfigurationProvider)
|
||
|
.to(GeneratorOutputConfigurationProvider)
|
||
|
.in(Singleton);
|
||
|
binder.bind(IFileSystemAccess2)
|
||
|
.to(JavaIoFileSystemAccess)
|
||
|
}
|
||
|
|
||
|
def Class<? extends IGenerator2> bindIGenerator2() {
|
||
|
// return DummyGenerator.class;
|
||
|
return typeof(CoreDslJsonGenerator)
|
||
|
}
|
||
|
|
||
|
}
|