org.eclipse.xtext.generator
Class DefaultGeneratorFragment

java.lang.Object
  extended by org.eclipse.xtext.generator.DefaultGeneratorFragment
All Implemented Interfaces:
IGeneratorFragment
Direct Known Subclasses:
AbstractGeneratorFragment, AntlrDelegatingFragment, BasicUiGeneratorFragment, BuilderIntegrationFragment, DelegatingGeneratorFragment, Ecore2XtextValueConverterServiceFragment, ExternalAntlrLexerFragment, ImplicitRuntimeFragment, LoggingGeneratorFragment, QualifiedNamesFragment, SimpleNamesFragment, TypesGeneratorFragment, Xtend2GeneratorFragment

public class DefaultGeneratorFragment
extends java.lang.Object
implements IGeneratorFragment

Author:
Sven Efftinge - Initial contribution and API

Constructor Summary
DefaultGeneratorFragment()
           
 
Method Summary
 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 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultGeneratorFragment

public DefaultGeneratorFragment()
Method Detail

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)

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

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

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

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

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

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.

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