本文整理汇总了Java中org.kie.workbench.common.services.refactoring.backend.server.indexing.DefaultIndexBuilder类的典型用法代码示例。如果您正苦于以下问题:Java DefaultIndexBuilder类的具体用法?Java DefaultIndexBuilder怎么用?Java DefaultIndexBuilder使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
DefaultIndexBuilder类属于org.kie.workbench.common.services.refactoring.backend.server.indexing包,在下文中一共展示了DefaultIndexBuilder类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: fillIndexBuilder
import org.kie.workbench.common.services.refactoring.backend.server.indexing.DefaultIndexBuilder; //导入依赖的package包/类
@Override
protected DefaultIndexBuilder fillIndexBuilder(final Path path) throws Exception {
final org.uberfire.backend.vfs.Path vfsPath = Paths.convert(path);
final KieProject project = kieProjectService.resolveProject(vfsPath);
if (project == null) {
logger.error("Unable to index " + path.toUri() + ", project could not be resolved.");
return null;
}
final Package _package = kieProjectService.resolvePackage(vfsPath);
if (_package == null) {
logger.error("Unable to index " + path.toUri() + ", package could not be resolved.");
return null;
}
return new DefaultIndexBuilder(vfsPath.getFileName(),
project,
_package);
}
示例2: fillIndexBuilder
import org.kie.workbench.common.services.refactoring.backend.server.indexing.DefaultIndexBuilder; //导入依赖的package包/类
@Override
public DefaultIndexBuilder fillIndexBuilder(final Path path) throws Exception {
InputStream inputStream = null;
try {
inputStream = ioService.newInputStream(path,
StandardOpenOption.READ);
final String drl = DecisionTableFactory.loadFromInputStream(inputStream,
null);
return fillDrlIndexBuilder(path, drl);
} finally {
if (inputStream != null) {
try {
inputStream.close();
} catch (IOException e) {
// no-op
}
}
}
}
示例3: fillIndexBuilder
import org.kie.workbench.common.services.refactoring.backend.server.indexing.DefaultIndexBuilder; //导入依赖的package包/类
@Override
public DefaultIndexBuilder fillIndexBuilder(final Path path) throws Exception {
final String content = ioService.readAllString(path);
final Scenario model = ScenarioXMLPersistence.getInstance().unmarshal(content);
final ModuleDataModelOracle dmo = getModuleDataModelOracle(path);
final Module project = moduleService.resolveModule(Paths.convert(path));
final Package pkg = moduleService.resolvePackage(Paths.convert(path));
final DefaultIndexBuilder builder = new DefaultIndexBuilder(Paths.convert(path).getFileName(),
project,
pkg);
final TestScenarioIndexVisitor visitor = new TestScenarioIndexVisitor(dmo,
builder,
model);
visitor.visit();
addReferencedResourcesToIndexBuilder(builder,
visitor);
return builder;
}
示例4: fillIndexBuilder
import org.kie.workbench.common.services.refactoring.backend.server.indexing.DefaultIndexBuilder; //导入依赖的package包/类
@Override
public DefaultIndexBuilder fillIndexBuilder(final Path path) throws Exception {
final String content = ioService.readAllString(path);
final ScoreCardModel model = GuidedScoreCardXMLPersistence.getInstance().unmarshall(content);
final ModuleDataModelOracle dmo = getModuleDataModelOracle(path);
final DefaultIndexBuilder builder = getIndexBuilder(path);
if (builder == null) {
return null;
}
final GuidedScoreCardIndexVisitor visitor = new GuidedScoreCardIndexVisitor(dmo, model);
visitor.visit();
addReferencedResourcesToIndexBuilder(builder, visitor);
return builder;
}
示例5: fillIndexBuilder
import org.kie.workbench.common.services.refactoring.backend.server.indexing.DefaultIndexBuilder; //导入依赖的package包/类
@Override
public DefaultIndexBuilder fillIndexBuilder(final Path path) throws Exception {
final String content = ioService.readAllString(path);
final GuidedDecisionTableEditorGraphModel model = GuidedDTGraphXMLPersistence.getInstance().unmarshal(content);
final DefaultIndexBuilder builder = getIndexBuilder(path);
if (builder == null) {
return null;
}
final GuidedDecisionTableGraphModelIndexVisitor visitor = new GuidedDecisionTableGraphModelIndexVisitor(builder,
model);
visitor.visit();
addReferencedResourcesToIndexBuilder(builder,
visitor);
return builder;
}
示例6: fillIndexBuilder
import org.kie.workbench.common.services.refactoring.backend.server.indexing.DefaultIndexBuilder; //导入依赖的package包/类
@Override
public DefaultIndexBuilder fillIndexBuilder(final Path path) throws Exception {
final String content = ioService.readAllString(path);
final TemplateModel model = RuleTemplateModelXMLPersistenceImpl.getInstance().unmarshal(content);
final DefaultIndexBuilder builder = getIndexBuilder(path);
if (builder == null) {
return null;
}
final GuidedRuleTemplateIndexVisitor visitor = new GuidedRuleTemplateIndexVisitor(builder,
model);
visitor.visit();
addReferencedResourcesToIndexBuilder(builder,
visitor);
return builder;
}
示例7: fillIndexBuilder
import org.kie.workbench.common.services.refactoring.backend.server.indexing.DefaultIndexBuilder; //导入依赖的package包/类
@Test
public void fillIndexBuilder() throws Exception {
Path path = PathFactory.newPath("SolverConfig.solver.xml",
"default:///test/SolverConfig.solver.xml");
when(projectService.resolveProject(path)).thenReturn(mock(KieProject.class));
when(projectService.resolvePackage(path)).thenReturn(mock(Package.class));
DefaultIndexBuilder indexBuilder = solverFileIndexer.fillIndexBuilder(Paths.convert(path));
assertNotNull(indexBuilder);
}
示例8: fillIndexBuilder
import org.kie.workbench.common.services.refactoring.backend.server.indexing.DefaultIndexBuilder; //导入依赖的package包/类
@Override
public DefaultIndexBuilder fillIndexBuilder(final Path path) throws Exception {
final List<String> lhs = new ArrayList<String>();
final List<String> rhs = new ArrayList<String>();
final String dsl = ioService.readAllString(path);
//Construct a dummy DRL file to parse index elements
final DSLTokenizedMappingFile dslLoader = new DSLTokenizedMappingFile();
if (dslLoader.parseAndLoad(new StringReader(dsl))) {
DSLMapping dslMapping = dslLoader.getMapping();
for (DSLMappingEntry e : dslMapping.getEntries()) {
switch (e.getSection()) {
case CONDITION:
lhs.add(e.getValuePattern());
break;
case CONSEQUENCE:
rhs.add(e.getValuePattern());
break;
default:
// no-op
}
}
final String drl = makeDrl(path,
lhs,
rhs);
return fillDrlIndexBuilder(path,
drl);
}
return null;
}
示例9: getIndexBuilder
import org.kie.workbench.common.services.refactoring.backend.server.indexing.DefaultIndexBuilder; //导入依赖的package包/类
@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);
}
};
}
示例10: TestScenarioIndexVisitor
import org.kie.workbench.common.services.refactoring.backend.server.indexing.DefaultIndexBuilder; //导入依赖的package包/类
public TestScenarioIndexVisitor(final ModuleDataModelOracle dmo,
final DefaultIndexBuilder builder,
final Scenario model) {
this.dmo = PortablePreconditions.checkNotNull("dmo",
dmo);
this.builder = PortablePreconditions.checkNotNull("builder",
builder);
this.model = PortablePreconditions.checkNotNull("model",
model);
}
示例11: fillIndexBuilder
import org.kie.workbench.common.services.refactoring.backend.server.indexing.DefaultIndexBuilder; //导入依赖的package包/类
@Override
public DefaultIndexBuilder fillIndexBuilder(final Path path) throws Exception {
final String dslr = ioService.readAllString(path);
final Expander expander = getDSLExpander(path);
final String drl = expander.expand(dslr);
return fillDrlIndexBuilder(path, drl);
}
示例12: GuidedDecisionTableGraphModelIndexVisitor
import org.kie.workbench.common.services.refactoring.backend.server.indexing.DefaultIndexBuilder; //导入依赖的package包/类
public GuidedDecisionTableGraphModelIndexVisitor(final DefaultIndexBuilder builder,
final GuidedDecisionTableEditorGraphModel model) {
this.builder = PortablePreconditions.checkNotNull("builder",
builder);
this.model = PortablePreconditions.checkNotNull("model",
model);
}
示例13: fillIndexBuilder
import org.kie.workbench.common.services.refactoring.backend.server.indexing.DefaultIndexBuilder; //导入依赖的package包/类
@Override
public DefaultIndexBuilder fillIndexBuilder(final Path path) throws Exception {
final String content = ioService.readAllString(path);
final GuidedDecisionTable52 model = GuidedDTXMLPersistence.getInstance().unmarshal(content);
final String drl = GuidedDTDRLPersistence.getInstance().marshal(model);
return fillDrlIndexBuilder(path,
drl);
}
示例14: GuidedRuleTemplateIndexVisitor
import org.kie.workbench.common.services.refactoring.backend.server.indexing.DefaultIndexBuilder; //导入依赖的package包/类
public GuidedRuleTemplateIndexVisitor(final DefaultIndexBuilder builder,
final TemplateModel model) {
this.builder = PortablePreconditions.checkNotNull("builder",
builder);
this.model = PortablePreconditions.checkNotNull("model",
model);
}
示例15: fillIndexBuilder
import org.kie.workbench.common.services.refactoring.backend.server.indexing.DefaultIndexBuilder; //导入依赖的package包/类
@Override
public DefaultIndexBuilder fillIndexBuilder(final Path path) throws Exception {
final String enumDefinition = ioService.readAllString(path);
final DataEnumLoader enumLoader = new DataEnumLoader(enumDefinition,
mvelEvaluator);
if (enumLoader.hasErrors()) {
logger.info("Unable to index '" + path.toUri().toString() + "'. Related errors follow:");
for (String e : enumLoader.getErrors()) {
logger.info(e);
}
}
final ModuleDataModelOracle dmo = getModuleDataModelOracle(path);
final DefaultIndexBuilder builder = getIndexBuilder(path);
if (builder == null) {
return null;
}
final EnumIndexVisitor visitor = new EnumIndexVisitor(dmo,
path,
enumLoader);
visitor.visit();
addReferencedResourcesToIndexBuilder(builder,
visitor);
return builder;
}