org.eclipse.xtext.generator
Class GeneratorComponent

java.lang.Object
  extended by org.eclipse.xtext.generator.GeneratorComponent
All Implemented Interfaces:
org.eclipse.emf.mwe2.runtime.workflow.IWorkflowComponent

public class GeneratorComponent
extends java.lang.Object
implements org.eclipse.emf.mwe2.runtime.workflow.IWorkflowComponent

Author:
Sven Efftinge - Initial contribution and API

Nested Class Summary
static class GeneratorComponent.Outlet
           
 
Constructor Summary
GeneratorComponent()
           
 
Method Summary
 void addOutlet(GeneratorComponent.Outlet out)
          an outlet is defined by a name and a path.
 void addSlot(java.lang.String slot)
          adds a slot name to look for Resources (the slot's contents might be a Resource or an Iterable of Resources).
protected  IGenerator getCompiler()
           
protected  IFileSystemAccess getConfiguredFileSystemAccess()
           
protected  java.util.Map<java.lang.String,OutputConfiguration> getOutputConfigurations()
           
 void invoke(org.eclipse.emf.mwe2.runtime.workflow.IWorkflowContext ctx)
           
 void postInvoke()
           
 void preInvoke()
           
 void setInjector(com.google.inject.Injector injector)
          sets the Injector to be used to obtain the used IGenerator instance.
 void setRegister(ISetup setup)
          registering an ISetup, which causes the execution of ISetup.createInjectorAndDoEMFRegistration() the resulting Inject is stored and used to obtain the used IGenerator.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GeneratorComponent

public GeneratorComponent()
Method Detail

setRegister

public void setRegister(ISetup setup)
registering an ISetup, which causes the execution of ISetup.createInjectorAndDoEMFRegistration() the resulting Inject is stored and used to obtain the used IGenerator.


setInjector

public void setInjector(com.google.inject.Injector injector)
sets the Injector to be used to obtain the used IGenerator instance.


addSlot

public void addSlot(java.lang.String slot)
adds a slot name to look for Resources (the slot's contents might be a Resource or an Iterable of Resources).


preInvoke

public void preInvoke()
Specified by:
preInvoke in interface org.eclipse.emf.mwe2.runtime.workflow.IWorkflowComponent

addOutlet

public void addOutlet(GeneratorComponent.Outlet out)
an outlet is defined by a name and a path. The generator will internally choose one of the configured outlets when generating a file. the given path defines the root directory of the outlet.


invoke

public void invoke(org.eclipse.emf.mwe2.runtime.workflow.IWorkflowContext ctx)
Specified by:
invoke in interface org.eclipse.emf.mwe2.runtime.workflow.IWorkflowComponent

getCompiler

protected IGenerator getCompiler()

getConfiguredFileSystemAccess

protected IFileSystemAccess getConfiguredFileSystemAccess()

postInvoke

public void postInvoke()
Specified by:
postInvoke in interface org.eclipse.emf.mwe2.runtime.workflow.IWorkflowComponent

getOutputConfigurations

protected java.util.Map<java.lang.String,OutputConfiguration> getOutputConfigurations()
Since:
2.3