Class ResourceDescriptionStrategyFragment
- java.lang.Object
-
- org.eclipse.xtext.xtext.generator.AbstractXtextGeneratorFragment
-
- org.eclipse.xtext.xtext.generator.AbstractStubGeneratingFragment
-
- org.eclipse.xtext.xtext.generator.AbstractInheritingFragment
-
- org.eclipse.xtext.xtext.generator.index.ResourceDescriptionStrategyFragment
-
- All Implemented Interfaces:
IGuiceAwareGeneratorComponent
,IXtextGeneratorFragment
public class ResourceDescriptionStrategyFragment extends AbstractInheritingFragment
By default the @link DefaultResourceDescriptionStrategy exposes all model element that have a name. That means a given ParserRule with a corresponding model type with a name gets stored to the index by default. Normally one would bind a custom impl of @link IDefaultResourceDescriptionStrategy to filter. By using this fragment and @Exported on a AbstractRule in the Xtext grammar the corresponding model element gets explicitly visible stored to the index and all others don't.
-
-
Constructor Summary
Constructors Constructor Description ResourceDescriptionStrategyFragment()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
contributeRuntimeGuiceBindings()
void
generate()
protected JavaFileAccess
generateResourceDescriptionStrategy(java.lang.Iterable<org.eclipse.xtext.AbstractRule> exportedRules)
protected void
generateResourceDescriptionStrategyStub(java.lang.Iterable<org.eclipse.xtext.AbstractRule> exportedRules)
protected TypeReference
getAbstractResourceDescriptionStrategyClass()
protected TypeReference
getDefaultResourceDescriptionStrategyClass()
protected java.util.List<org.eclipse.xtext.AbstractRule>
getExportedRulesFromGrammar()
protected TypeReference
getResourceDescriptionStrategyClass(org.eclipse.xtext.Grammar grammar)
protected TypeReference
getResourceDescriptionSuperClass()
protected TypeReference
getStubResourceDescriptionStrategyClass()
protected TypeReference
getSuperTypeRef()
protected boolean
isExported(org.eclipse.xtext.AbstractRule rule)
boolean
isGenerate()
protected boolean
needsToInvokeSuperResourceDescriptionStrategy()
void
setGenerate(boolean generate)
protected boolean
shouldGenerateArtefacts(java.lang.Iterable<org.eclipse.xtext.AbstractRule> exportedRules)
-
Methods inherited from class org.eclipse.xtext.xtext.generator.AbstractInheritingFragment
isInheritImplementation, setInheritImplementation
-
Methods inherited from class org.eclipse.xtext.xtext.generator.AbstractStubGeneratingFragment
getGenerateStub, isGenerateStub, isGenerateXtendStub, setGenerateStub, setGenerateXtendStub
-
Methods inherited from class org.eclipse.xtext.xtext.generator.AbstractXtextGeneratorFragment
checkConfiguration, getGrammar, getLanguage, getProjectConfig, initialize
-
-
-
-
Method Detail
-
getDefaultResourceDescriptionStrategyClass
protected TypeReference getDefaultResourceDescriptionStrategyClass()
-
getAbstractResourceDescriptionStrategyClass
protected TypeReference getAbstractResourceDescriptionStrategyClass()
-
getResourceDescriptionStrategyClass
protected TypeReference getResourceDescriptionStrategyClass(org.eclipse.xtext.Grammar grammar)
-
getStubResourceDescriptionStrategyClass
protected TypeReference getStubResourceDescriptionStrategyClass()
-
needsToInvokeSuperResourceDescriptionStrategy
protected boolean needsToInvokeSuperResourceDescriptionStrategy()
-
getResourceDescriptionSuperClass
protected TypeReference getResourceDescriptionSuperClass()
-
contributeRuntimeGuiceBindings
protected void contributeRuntimeGuiceBindings()
-
getExportedRulesFromGrammar
protected java.util.List<org.eclipse.xtext.AbstractRule> getExportedRulesFromGrammar()
-
generate
public void generate()
-
shouldGenerateArtefacts
protected boolean shouldGenerateArtefacts(java.lang.Iterable<org.eclipse.xtext.AbstractRule> exportedRules)
-
getSuperTypeRef
protected TypeReference getSuperTypeRef()
-
generateResourceDescriptionStrategy
protected JavaFileAccess generateResourceDescriptionStrategy(java.lang.Iterable<org.eclipse.xtext.AbstractRule> exportedRules)
-
generateResourceDescriptionStrategyStub
protected void generateResourceDescriptionStrategyStub(java.lang.Iterable<org.eclipse.xtext.AbstractRule> exportedRules)
-
isExported
protected boolean isExported(org.eclipse.xtext.AbstractRule rule)
-
isGenerate
@Pure public boolean isGenerate()
-
setGenerate
public void setGenerate(boolean generate)
-
-