当前位置: 首页>>代码示例>>Java>>正文


Java DefaultIndexBuilder类代码示例

本文整理汇总了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);
}
 
开发者ID:kiegroup,项目名称:optaplanner-wb,代码行数:18,代码来源:SolverFileIndexer.java

示例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
            }
        }
    }
}
 
开发者ID:kiegroup,项目名称:drools-wb,代码行数:21,代码来源:DecisionTableXLSFileIndexer.java

示例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;
}
 
开发者ID:kiegroup,项目名称:drools-wb,代码行数:23,代码来源:TestScenarioFileIndexer.java

示例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;
}
 
开发者ID:kiegroup,项目名称:drools-wb,代码行数:19,代码来源:GuidedScoreCardFileIndexer.java

示例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;
}
 
开发者ID:kiegroup,项目名称:drools-wb,代码行数:19,代码来源:GuidedDecisionTableGraphFileIndexer.java

示例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;
}
 
开发者ID:kiegroup,项目名称:drools-wb,代码行数:19,代码来源:GuidedRuleTemplateFileIndexer.java

示例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);
}
 
开发者ID:kiegroup,项目名称:optaplanner-wb,代码行数:13,代码来源:SolverFileIndexerTest.java

示例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;
}
 
开发者ID:kiegroup,项目名称:drools-wb,代码行数:35,代码来源:DslFileIndexer.java

示例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);
        }
    };
}
 
开发者ID:kiegroup,项目名称:drools-wb,代码行数:29,代码来源:DslFileIndexer.java

示例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);
}
 
开发者ID:kiegroup,项目名称:drools-wb,代码行数:11,代码来源:TestScenarioIndexVisitor.java

示例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);
}
 
开发者ID:kiegroup,项目名称:drools-wb,代码行数:10,代码来源:GuidedRuleDslrFileIndexer.java

示例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);
}
 
开发者ID:kiegroup,项目名称:drools-wb,代码行数:8,代码来源:GuidedDecisionTableGraphModelIndexVisitor.java

示例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);
}
 
开发者ID:kiegroup,项目名称:drools-wb,代码行数:10,代码来源:GuidedDecisionTableFileIndexer.java

示例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);
}
 
开发者ID:kiegroup,项目名称:drools-wb,代码行数:8,代码来源:GuidedRuleTemplateIndexVisitor.java

示例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;
}
 
开发者ID:kiegroup,项目名称:drools-wb,代码行数:29,代码来源:EnumFileIndexer.java


注:本文中的org.kie.workbench.common.services.refactoring.backend.server.indexing.DefaultIndexBuilder类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。