org.eclipse.xtext.generator
Class CompositeGeneratorFragment

java.lang.Object
  extended by org.eclipse.xtext.generator.CompositeGeneratorFragment
All Implemented Interfaces:
IGeneratorFragment, NamingAware
Direct Known Subclasses:
LanguageConfig

public class CompositeGeneratorFragment
extends java.lang.Object
implements IGeneratorFragment, NamingAware

Author:
Sven Efftinge - Initial contribution and API simple composite generator fragment implementation. delegating all callbacks to its contained fragments

Field Summary
protected  java.util.List<IGeneratorFragment> fragments
           
 
Constructor Summary
CompositeGeneratorFragment()
           
 
Method Summary
 void addFragment(IGeneratorFragment fragment)
           
 void addFragments(CompositeGeneratorFragment fragment)
           
 void addLog(LoggingGeneratorFragment message)
           
 void addToPluginXmlRt(Grammar grammar, org.eclipse.xpand2.XpandExecutionContext ctx)
          Used to add code to the plugin.xml of the runtime bundle.
 void addToPluginXmlUi(Grammar grammar, org.eclipse.xpand2.XpandExecutionContext ctx)
          Used to add code to the plugin.xml of the ui bundle.
 void addToStandaloneSetup(Grammar grammar, org.eclipse.xpand2.XpandExecutionContext ctx)
          Used to add code to the generated 'public void register(Injector injector)'-method
 void addWarn(LoggingGeneratorFragment message)
           
 void checkConfiguration(org.eclipse.emf.mwe.core.issues.Issues issues)
          Called by the container after configuration so the component can validate the configuration before invocation.
 void generate(Grammar grammar, org.eclipse.xpand2.XpandExecutionContext ctx)
          can be used to generate whatever necessary
 java.lang.String[] getExportedPackagesRt(Grammar grammar)
          return the exported packages for the runtime bundle
 java.lang.String[] getExportedPackagesUi(Grammar grammar)
          return the exported packages for the ui bundle
 java.util.Set<Binding> getGuiceBindingsRt(Grammar grammar)
          return a map containing the contributed guice bindings created in this generator fragment
 java.util.Set<Binding> getGuiceBindingsUi(Grammar grammar)
          return a map containing the contributed guice bindings for the ui part created in this generator fragment
 java.lang.String[] getImportedPackagesRt(Grammar grammar)
          return the imported packages for the runtime bundle
 java.lang.String[] getImportedPackagesUi(Grammar grammar)
          return the imported packages for the ui bundle
 java.lang.String[] getRequiredBundlesRt(Grammar grammar)
          return the bundles this fragment requires at runtime
 java.lang.String[] getRequiredBundlesUi(Grammar grammar)
          return the bundles this fragment requires in ui
 void registerNaming(Naming n)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fragments

protected final java.util.List<IGeneratorFragment> fragments
Constructor Detail

CompositeGeneratorFragment

public CompositeGeneratorFragment()
Method Detail

addFragment

public void addFragment(IGeneratorFragment fragment)

addFragments

public void addFragments(CompositeGeneratorFragment fragment)

addLog

public void addLog(LoggingGeneratorFragment message)

addWarn

public void addWarn(LoggingGeneratorFragment message)

addToPluginXmlRt

public void addToPluginXmlRt(Grammar grammar,
                             org.eclipse.xpand2.XpandExecutionContext ctx)
Description copied from interface: IGeneratorFragment
Used to add code to the plugin.xml of the runtime bundle. The surrounding tags are added automatically

Specified by:
addToPluginXmlRt in interface IGeneratorFragment
ctx - - the execution context to use (the plugin.xml file is already opened)

addToPluginXmlUi

public void addToPluginXmlUi(Grammar grammar,
                             org.eclipse.xpand2.XpandExecutionContext ctx)
Description copied from interface: IGeneratorFragment
Used to add code to the plugin.xml of the ui bundle. The surrounding tags are added automatically

Specified by:
addToPluginXmlUi in interface IGeneratorFragment
ctx - - the execution context to use (the plugin.xml file is already opened)

addToStandaloneSetup

public void addToStandaloneSetup(Grammar grammar,
                                 org.eclipse.xpand2.XpandExecutionContext ctx)
Description copied from interface: IGeneratorFragment
Used to add code to the generated 'public void register(Injector injector)'-method

Specified by:
addToStandaloneSetup in interface IGeneratorFragment
ctx - - the execution context to use (the file is already opened, content goes into the register method)

generate

public void generate(Grammar grammar,
                     org.eclipse.xpand2.XpandExecutionContext ctx)
Description copied from interface: IGeneratorFragment
can be used to generate whatever necessary

Specified by:
generate in interface IGeneratorFragment
ctx - - the execution context to use

getExportedPackagesRt

public java.lang.String[] getExportedPackagesRt(Grammar grammar)
Description copied from interface: IGeneratorFragment
return the exported packages for the runtime bundle

Specified by:
getExportedPackagesRt in interface IGeneratorFragment

getImportedPackagesRt

public java.lang.String[] getImportedPackagesRt(Grammar grammar)
Description copied from interface: IGeneratorFragment
return the imported packages for the runtime bundle

Specified by:
getImportedPackagesRt in interface IGeneratorFragment

getExportedPackagesUi

public java.lang.String[] getExportedPackagesUi(Grammar grammar)
Description copied from interface: IGeneratorFragment
return the exported packages for the ui bundle

Specified by:
getExportedPackagesUi in interface IGeneratorFragment

getImportedPackagesUi

public java.lang.String[] getImportedPackagesUi(Grammar grammar)
Description copied from interface: IGeneratorFragment
return the imported packages for the ui bundle

Specified by:
getImportedPackagesUi in interface IGeneratorFragment

getGuiceBindingsRt

public java.util.Set<Binding> getGuiceBindingsRt(Grammar grammar)
Description copied from interface: IGeneratorFragment
return a map containing the contributed guice bindings created in this generator fragment

Specified by:
getGuiceBindingsRt in interface IGeneratorFragment

getGuiceBindingsUi

public java.util.Set<Binding> getGuiceBindingsUi(Grammar grammar)
Description copied from interface: IGeneratorFragment
return a map containing the contributed guice bindings for the ui part created in this generator fragment

Specified by:
getGuiceBindingsUi in interface IGeneratorFragment

getRequiredBundlesRt

public java.lang.String[] getRequiredBundlesRt(Grammar grammar)
Description copied from interface: IGeneratorFragment
return the bundles this fragment requires at runtime

Specified by:
getRequiredBundlesRt in interface IGeneratorFragment

getRequiredBundlesUi

public java.lang.String[] getRequiredBundlesUi(Grammar grammar)
Description copied from interface: IGeneratorFragment
return the bundles this fragment requires in ui

Specified by:
getRequiredBundlesUi in interface IGeneratorFragment

checkConfiguration

public void checkConfiguration(org.eclipse.emf.mwe.core.issues.Issues issues)
Description copied from interface: IGeneratorFragment
Called by the container after configuration so the component can validate the configuration before invocation.

Specified by:
checkConfiguration in interface IGeneratorFragment
Parameters:
issues - implementors should report configuration issues to this.

registerNaming

public void registerNaming(Naming n)
Specified by:
registerNaming in interface NamingAware