org.kie.soup.project.datamodel.imports.Import.<init>()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(9.1k)|赞(0)|评价(0)|浏览(221)

本文整理了Java中org.kie.soup.project.datamodel.imports.Import.<init>()方法的一些代码示例,展示了Import.<init>()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Import.<init>()方法的具体详情如下:
包路径:org.kie.soup.project.datamodel.imports.Import
类名称:Import
方法名:<init>

Import.<init>介绍

暂无

代码示例

代码示例来源:origin: org.kie.workbench.widgets/kie-wb-common-ui

private static boolean isImported(final String qualifiedType,
                   final Imports imports) {
    final Import item = new Import(qualifiedType.replaceAll("\\$",
                                "."));
    return imports.contains(item);
  }
}

代码示例来源:origin: org.kie.workbench.services/kie-wb-common-services-backend

private ProjectImports createProjectImports() {
  ProjectImports projectImports = new ProjectImports();
  final Imports imports = projectImports.getImports();
  imports.addImport(new Import(java.lang.Number.class.getName()));
  imports.addImport(new Import(java.lang.Boolean.class.getName()));
  imports.addImport(new Import(java.lang.String.class.getName()));
  imports.addImport(new Import(java.lang.Integer.class.getName()));
  imports.addImport(new Import(java.lang.Double.class.getName()));
  imports.addImport(new Import(java.util.List.class.getName()));
  imports.addImport(new Import(java.util.Collection.class.getName()));
  imports.addImport(new Import(java.util.ArrayList.class.getName()));
  return projectImports;
}

代码示例来源:origin: org.kie.workbench.screens/kie-wb-common-library-client

public void addNewExternalDataObjects() {
  itemPresenters.add(new Import(""));
  fireChangeEvent();
}

代码示例来源:origin: org.drools/drools-wb-test-scenario-editor-backend

void addDependentImportsToScenario(final Scenario scenario,
                  final Path path) {
  final PackageDataModelOracle dataModel = getDataModel(path);
  final Set<String> usedFullyQualifiedClassNames = getUsedFullyQualifiedClassNames(scenario,
                                           dataModel);
  for (String className : usedFullyQualifiedClassNames) {
    final Import imp = new Import(className);
    final List<Import> scenarioImports = scenario.getImports().getImports();
    if (!scenarioImports.contains(imp)) {
      scenarioImports.add(imp);
    }
  }
}

代码示例来源:origin: kiegroup/drools-wb

void addDependentImportsToScenario(final Scenario scenario,
                  final Path path) {
  final PackageDataModelOracle dataModel = getDataModel(path);
  final Set<String> usedFullyQualifiedClassNames = getUsedFullyQualifiedClassNames(scenario,
                                           dataModel);
  for (String className : usedFullyQualifiedClassNames) {
    final Import imp = new Import(className);
    final List<Import> scenarioImports = scenario.getImports().getImports();
    if (!scenarioImports.contains(imp)) {
      scenarioImports.add(imp);
    }
  }
}

代码示例来源:origin: org.drools/drools-wb-guided-dtable-editor-client

@Override
public void addImport(final String fqcn) {
  //Filter DMO
  final Import addedImport = new Import(fqcn);
  model.getImports().addImport(addedImport);
  oracle.filter(model.getImports());
  //Signal change to any other interested consumers (e.g. some editors support rendering of unknown fact-types)
  importAddedEvent.fire(new ImportAddedEvent(oracle,
                        addedImport));
}

代码示例来源:origin: kiegroup/drools-wb

@Override
public void addImport(final String fqcn) {
  //Filter DMO
  final Import addedImport = new Import(fqcn);
  model.getImports().addImport(addedImport);
  oracle.filter(model.getImports());
  //Signal change to any other interested consumers (e.g. some editors support rendering of unknown fact-types)
  importAddedEvent.fire(new ImportAddedEvent(oracle,
                        addedImport));
}

代码示例来源:origin: org.drools/drools-wb-guided-dtable-editor-client

@Override
public boolean removeImport(final String fqcn) {
  //Check import can be removed
  if (validator.isTypeUsed(fqcn)) {
    return false;
  }
  //Filter DMO
  final Import removedImport = new Import(fqcn);
  model.getImports().removeImport(removedImport);
  oracle.filter(model.getImports());
  //Signal change to any other interested consumers (e.g. some editors support rendering of unknown fact-types)
  importRemovedEvent.fire(new ImportRemovedEvent(oracle,
                          removedImport));
  return true;
}

代码示例来源:origin: org.kie.workbench.services/kie-wb-common-services-backend

@Test
public void testProjectImportsLoad_Exists() throws URISyntaxException {
  when(ioService.exists(any(org.uberfire.java.nio.file.Path.class))).thenReturn(true);
  final ProjectImports projectImports = projectImportsService.load(pathToImports);
  verify(ioService,
      never()).write(any(org.uberfire.java.nio.file.Path.class),
             any(String.class));
  verify(ioService,
      times(1)).readAllString(any(org.uberfire.java.nio.file.Path.class));
  // projects imports need always to contain java.lang.Number
  // because of the guided rule editor
  assertTrue(projectImports.getImports().contains(new Import(Number.class)));
}

代码示例来源:origin: org.kie.workbench.services/kie-wb-common-services-backend

@Test
public void testProjectImportsLoad_NotExists() throws URISyntaxException {
  when(ioService.exists(any(org.uberfire.java.nio.file.Path.class))).thenReturn(false);
  final ProjectImports projectImports = projectImportsService.load(pathToImports);
  verify(ioService,
      times(1)).write(any(org.uberfire.java.nio.file.Path.class),
              importsArgumentCaptor.capture());
  assertExternalDataObjects(importsArgumentCaptor.getValue());
  // projects imports need always to contain java.lang.Number
  // because of the guided rule editor
  assertTrue(projectImports.getImports().contains(new Import(Number.class)));
}

代码示例来源:origin: org.kie.workbench.screens/kie-wb-common-library-client

@Test
  public void testAddNewExternalDataObjects() {
    externalDataObjectsPresenter.addNewExternalDataObjects();
    verify(itemPresenters).add(new Import(""));
  }
}

代码示例来源:origin: org.kie.workbench.screens/kie-wb-common-library-client

@Test
public void testSetup() {
  final Import import_ = new Import("type");
  externalDataObjectsItemPresenter.setup(import_, mock(ExternalDataObjectsPresenter.class));
  verify(view).init(eq(externalDataObjectsItemPresenter));
  verify(view).setTypeName(eq("type"));
  assertEquals(import_, externalDataObjectsItemPresenter.getObject());
}

代码示例来源:origin: org.kie.workbench.widgets/kie-wb-config-resource-widget

@Before
public void setup() {
  this.presenter = new ImportsWidgetPresenter(view);
  imports.getImports().addImport(new Import("import1"));
  imports.getImports().addImport(new Import("import2"));
}

代码示例来源:origin: org.uberfire/uberfire-project-backend

@Test
  public void testImports() throws Exception {
    ProjectImports configuration = new ProjectImports();
    configuration.getImports().addImport(new Import("java.util.List"));
    configuration.getImports().addImport(new Import("org.test.Object"));
    String xml = handler.toString(configuration);
    assertTrue(xml.contains("<import>"));
    assertTrue(xml.contains("</import>"));
    assertTrue(xml.contains("<type>java.util.List</type>"));
    assertTrue(xml.contains("<type>org.test.Object</type>"));
  }
}

代码示例来源:origin: kiegroup/appformer

@Test
  public void testImports() throws Exception {
    ProjectImports configuration = new ProjectImports();
    configuration.getImports().addImport(new Import("java.util.List"));
    configuration.getImports().addImport(new Import("org.test.Object"));
    String xml = handler.toString(configuration);
    assertTrue(xml.contains("<import>"));
    assertTrue(xml.contains("</import>"));
    assertTrue(xml.contains("<type>java.util.List</type>"));
    assertTrue(xml.contains("<type>org.test.Object</type>"));
  }
}

代码示例来源:origin: org.kie.workbench.widgets/kie-wb-config-resource-widget

@Test
public void testOnImportRemovedExternal() {
  final Imports imports = new Imports();
  imports.addImport(new Import("org.pkg1.External1"));
  presenter.setContent(dmo,
             imports,
             false);
  presenter.onRemoveImport(new Import("org.pkg1.External1"));
  assertEquals(0,
         imports.getImports().size());
  assertContains("org.pkg1.External1",
          presenter.getExternalFactTypes());
}

代码示例来源:origin: kiegroup/drools-wb

@Test
public void noFQCNUsed() throws Exception {
  final ScenarioSimulationModel simulationModel = new ScenarioSimulationModel();
  simulationModel.getImports().addImport(new Import("org.test.Test"));
  final String xml = instance.marshal(simulationModel);
  assertFalse(xml.contains("org.drools.workbench.screens.scenariosimulation.model"));
  assertFalse(xml.contains("org.kie.soup.project.datamodel.imports"));
}

代码示例来源:origin: org.kie.workbench.widgets/kie-wb-config-resource-widget

@Test
public void isInternalImportInternalImportType() {
  final Imports imports = new Imports();
  final Import importType = new Import("Internal1");
  imports.addImport(importType);
  presenter.setContent(dmo,
             imports,
             false);
  assertTrue(presenter.isInternalImport(importType));
}

代码示例来源:origin: org.kie.workbench.widgets/kie-wb-config-resource-widget

@Test
public void isInternalImportExternalImportType() {
  final Imports imports = new Imports();
  final Import importType = new Import("External1");
  imports.addImport(importType);
  presenter.setContent(dmo,
             imports,
             false);
  assertFalse(presenter.isInternalImport(importType));
}

代码示例来源:origin: org.kie.workbench.widgets/kie-wb-config-resource-widget

@Test
public void testOnImportAddedExternal() {
  final Imports imports = new Imports();
  presenter.setContent(dmo,
             imports,
             false);
  presenter.onAddImport(new Import("org.pkg1.External1"));
  assertEquals(1,
         imports.getImports().size());
  assertContains("org.pkg1.External1",
          imports.getImports());
  assertNotContains("org.pkg1.External1",
           presenter.getExternalFactTypes());
  verify(dmo).filter();
}

相关文章