org.eclipse.xtext.generator.xbase
Class XbaseGeneratorFragment

java.lang.Object
  extended by org.eclipse.xtext.generator.DefaultGeneratorFragment
      extended by org.eclipse.xtext.generator.AbstractGeneratorFragment
          extended by org.eclipse.xtext.generator.xbase.XbaseGeneratorFragment
All Implemented Interfaces:
IGeneratorFragment, NamingAware

public class XbaseGeneratorFragment
extends AbstractGeneratorFragment

Prepares a host language to embed Xbase. Use with TypesGeneratorFragment.

Author:
Jan Koehnlein - Initial contribution and API, Sven Efftinge, Holger Schill

Constructor Summary
XbaseGeneratorFragment()
           
 
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
static boolean doesUseXbase(Grammar grammar)
           
 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.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
static java.lang.String getJvmModelInferrerName(Grammar grammar, Naming naming)
           
protected  java.util.List<java.lang.Object> getParameters(Grammar grammar)
           
 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 setGenerateXtendInferrer(boolean generateXtendInferrer)
           
 void setJdtCallHierachy(boolean jdtCallHierachy)
           
 void setJdtTypeHierarchy(boolean jdtTypeHierarchy)
           
 void setUseInferredJvmModel(boolean useInferredJvmModel)
           
protected  boolean usesXbaseGrammar(Grammar grammar)
           
 
Methods inherited from class org.eclipse.xtext.generator.AbstractGeneratorFragment
addToPluginXmlTests, getExportedPackagesUi, getNaming, getTemplate, registerNaming
 
Methods inherited from class org.eclipse.xtext.generator.DefaultGeneratorFragment
checkConfiguration, getImportedPackagesRt, getImportedPackagesUi
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XbaseGeneratorFragment

public XbaseGeneratorFragment()
Method Detail

usesXbaseGrammar

protected boolean usesXbaseGrammar(Grammar grammar)

doesUseXbase

public static boolean doesUseXbase(Grammar grammar)

setGenerateXtendInferrer

public void setGenerateXtendInferrer(boolean generateXtendInferrer)

setUseInferredJvmModel

public void setUseInferredJvmModel(boolean useInferredJvmModel)

setJdtTypeHierarchy

public void setJdtTypeHierarchy(boolean jdtTypeHierarchy)

setJdtCallHierachy

public void setJdtCallHierachy(boolean jdtCallHierachy)

getJvmModelInferrerName

public static java.lang.String getJvmModelInferrerName(Grammar grammar,
                                                       Naming naming)

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
Overrides:
getGuiceBindingsRt in class AbstractGeneratorFragment

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
Overrides:
getGuiceBindingsUi in class AbstractGeneratorFragment

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
Overrides:
getRequiredBundlesRt in class AbstractGeneratorFragment

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
Overrides:
getRequiredBundlesUi in class AbstractGeneratorFragment

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
Overrides:
generate in class AbstractGeneratorFragment
ctx - - the execution context to use

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
Overrides:
addToPluginXmlRt in class AbstractGeneratorFragment
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
Overrides:
addToPluginXmlUi in class AbstractGeneratorFragment
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
Overrides:
addToStandaloneSetup in class AbstractGeneratorFragment
ctx - - the execution context to use (the file is already opened, content goes into the register method)

getParameters

protected java.util.List<java.lang.Object> getParameters(Grammar grammar)
Overrides:
getParameters in class AbstractGeneratorFragment

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
Overrides:
getExportedPackagesRt in class AbstractGeneratorFragment