Skip to content

Commit

Permalink
Updated DI - inject less / update RuntimeModule with injectable classes
Browse files Browse the repository at this point in the history
Also reorganize RuntimeModule to group all 'standard' (XText based)
interfaces at the top of the file.
  • Loading branch information
steve-hickman-epistimis committed Dec 22, 2023
1 parent bc4e146 commit 6b34717
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,6 @@ public abstract class EntityProcessor<Characteristic extends EObject, Entity ext
@Inject
IQualifiedNameConverter qnc;

@Inject
CLPExtractors clp;

static Logger logger = Logger.getLogger(QueryProcessor.class);

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
public class NavigationUtilities {

@Inject IndexUtilities iu;
@Inject ConceptualEntityProcessor cep;

/**
* Walk up the containment hierarchy until we find a container that fails the test.
Expand Down
52 changes: 29 additions & 23 deletions com.epistimis.uddl/src/com/epistimis/uddl/UddlRuntimeModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,28 @@ public Class<? extends IQualifiedNameProvider> bindIQualifiedNameProvider() {
// TODO Auto-generated method stub
return UddlQNP.class;
}

/**
* Enable this if there are performance issues with name resolution. And then
* look at the strategy to see what should be excluded from the index
*/
public Class<? extends IDefaultResourceDescriptionStrategy> bindIDefaultResourceDescriptionStrategy() {
return UddlResourceDescriptionStrategy.class;
}

// // Enable imports by uncommenting this. The default is to import anything visible in a project
// // See section 3.3.1,3.3.2 of the Advanced XText Manual PDF
// // or https://blogs.itemis.com/en/in-five-minutes-to-transitive-imports-within-a-dsl-with-xtext
// @Override
// public
// Class<? extends IGlobalScopeProvider> bindIGlobalScopeProvider() {
// return UddlGlobalScopeProvider.class;
// }

public Class<? extends IQualifiedNameConverter> bindIQualifiedNameConverter() {
return IQualifiedNameConverter.DefaultImpl.class;
}

/**
* Inject this if you want the additional methods provided by this QNP
* @return
Expand All @@ -51,10 +73,10 @@ public Class<? extends IndexUtilities> bindIndexUtilities() {
}


public Class<? extends IQualifiedNameConverter> bindIQualifiedNameConverter() {
return IQualifiedNameConverter.DefaultImpl.class;
public Class<? extends com.epistimis.uddl.CLPExtractors> bindCLPExtractors() {
return CLPExtractors.class;
}

public Class<? extends ConceptualQueryProcessor> bindConceptualQueryProcessor() {
return ConceptualQueryProcessor.class;
}
Expand All @@ -65,29 +87,13 @@ public Class<? extends PlatformQueryProcessor> bindPlatformQueryProcessor() {
return PlatformQueryProcessor.class;
}

public Class<? extends com.epistimis.uddl.CLPExtractors> bindCLPExtractors() {
return CLPExtractors.class;
}

// ----------- Taxonomy processors
public Class<? extends com.epistimis.uddl.LogicalEnumeratedProcessor> bindLogicalEnumeratedProcessor() {
return LogicalEnumeratedProcessor.class;
}

/**
* Enable this if there are performance issues with name resolution. And then
* look at the strategy to see what should be excluded from the index
*/
public Class<? extends IDefaultResourceDescriptionStrategy> bindIDefaultResourceDescriptionStrategy() {
return UddlResourceDescriptionStrategy.class;
public Class<? extends com.epistimis.uddl.TaxonomyBaseProcessor> bindTaxonomyBaseProcessor() {
return TaxonomyBaseProcessor.class;
}

// // Enable imports by uncommenting this. The default is to import anything visible in a project
// // See section 3.3.1,3.3.2 of the Advanced XText Manual PDF
// // or https://blogs.itemis.com/en/in-five-minutes-to-transitive-imports-within-a-dsl-with-xtext
// @Override
// public
// Class<? extends IGlobalScopeProvider> bindIGlobalScopeProvider() {
// return UddlGlobalScopeProvider.class;
// }


}

0 comments on commit 6b34717

Please sign in to comment.