use of org.kie.workbench.common.services.refactoring.IndexElementsGenerator in project drools-wb by kiegroup.
the class DslFileIndexer method getIndexBuilder.
@Override
protected DefaultIndexBuilder getIndexBuilder(Path path) {
final Module module = moduleService.resolveModule(Paths.convert(path));
if (module == null) {
logger.error("Unable to index " + path.toUri().toString() + ": module could not be resolved.");
return null;
}
final Package pkg = moduleService.resolvePackage(Paths.convert(path));
if (pkg == null) {
logger.error("Unable to index " + path.toUri().toString() + ": package could not be resolved.");
return null;
}
// responsible for basic index info: module name, branch, etc
return new DefaultIndexBuilder(Paths.convert(path).getFileName(), module, pkg) {
@Override
public DefaultIndexBuilder addGenerator(final IndexElementsGenerator generator) {
// Don't include the rule created to parse DSL
if (generator instanceof Resource && ((Resource) generator).getResourceFQN().endsWith(MOCK_RULE_NAME)) {
return this;
}
return super.addGenerator(generator);
}
};
}
Aggregations