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

Constructor Summary
XbaseGeneratorFragment()
           
 
Method Summary
 void generate(Grammar grammar, org.eclipse.xpand2.XpandExecutionContext ctx)
          can be used to generate whatever necessary
 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)
           
static java.lang.String getJvmRenameStrategyName(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 setUseInferredJvmModel(boolean useInferredJvmModel)
           
protected  boolean usesXbaseGrammar(Grammar grammar)
           
 
Methods inherited from class org.eclipse.xtext.generator.AbstractGeneratorFragment
addToPluginXmlRt, addToPluginXmlUi, addToStandaloneSetup, getExportedPackagesRt, 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)

setGenerateXtendInferrer

public void setGenerateXtendInferrer(boolean generateXtendInferrer)

setUseInferredJvmModel

public void setUseInferredJvmModel(boolean useInferredJvmModel)

getJvmModelInferrerName

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

getJvmRenameStrategyName

public static java.lang.String getJvmRenameStrategyName(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

getParameters

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