Class 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 Detail

      • ResourceDescriptionStrategyFragment

        public ResourceDescriptionStrategyFragment()
    • 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)
      • 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)