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

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

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

Import.getType介绍

暂无

代码示例

代码示例来源:origin: org.kie.soup/kie-soup-project-datamodel-api

public Set<String> getImportStrings() {
  Set<String> strings = new HashSet<>();
  for (Import item : imports) {
    strings.add(item.getType());
  }
  return strings;
}

代码示例来源:origin: org.kie.soup/kie-soup-project-datamodel-api

public String toString() {
  final StringBuilder sb = new StringBuilder();
  for (final Import i : imports) {
    sb.append("import ").append(i.getType()).append(";\n");
  }
  return sb.toString();
}

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

private String convertToFullyQualifiedClassName(final String factType) {
    if (factType.contains(".")) {
      return factType;
    }
    String fullyQualifiedClassName = null;
    for (Import imp : imports.getImports()) {
      if (imp.getType().endsWith(factType)) {
        fullyQualifiedClassName = imp.getType();
        break;
      }
    }
    if (fullyQualifiedClassName == null) {
      fullyQualifiedClassName = packageName + "." + factType;
    }
    return fullyQualifiedClassName;
  }
}

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

private String convertToFullyQualifiedClassName(final String factType) {
  if (factType.contains(".")) {
    return factType;
  }
  String fullyQualifiedClassName = null;
  for (Import imp : imports.getImports()) {
    if (imp.getType().endsWith(factType)) {
      fullyQualifiedClassName = imp.getType();
      break;
    }
  }
  if (fullyQualifiedClassName == null) {
    fullyQualifiedClassName = packageName + "." + factType;
  }
  return fullyQualifiedClassName;
}

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

private String convertToFullyQualifiedClassName(final String factType) {
  if (factType.contains(".")) {
    return factType;
  }
  String fullyQualifiedClassName = null;
  for (Import imp : imports.getImports()) {
    if (imp.getType().endsWith(factType)) {
      fullyQualifiedClassName = imp.getType();
      break;
    }
  }
  if (fullyQualifiedClassName == null) {
    fullyQualifiedClassName = packageName + "." + factType;
  }
  return fullyQualifiedClassName;
}

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

private String convertToFullyQualifiedClassName(final String factType) {
  if (factType.contains(".")) {
    return factType;
  }
  String fullyQualifiedClassName = null;
  for (Import imp : imports.getImports()) {
    if (imp.getType().endsWith(factType)) {
      fullyQualifiedClassName = imp.getType();
      break;
    }
  }
  if (fullyQualifiedClassName == null) {
    fullyQualifiedClassName = packageName + "." + factType;
  }
  return fullyQualifiedClassName;
}

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

private void addClass(final Import item) {
  try {
    Class clazz = this.getClass().getClassLoader().loadClass(item.getType());
    pdBuilder.addClass(clazz,
              false,
              TypeSource.JAVA_DEPENDENCY);
  } catch (ClassNotFoundException cnfe) {
    //Class resolution would have happened in Builder and reported as warnings so log error here at debug level to avoid flooding logs
    log.debug(cnfe.getMessage());
  } catch (IOException ioe) {
    log.debug(ioe.getMessage());
  }
}

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

private String getFullyQualifiedClassName(final String typeName) {
  if (typeName.contains(".")) {
    return typeName;
  }
  for (Import i : model.getImports().getImports()) {
    if (i.getType().endsWith(typeName)) {
      return i.getType();
    }
  }
  final String packageName = model.getPackageName();
  return (!(packageName == null || packageName.isEmpty()) ? packageName + "." + typeName : typeName);
}

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

private String getFullyQualifiedClassName(final String typeName) {
  if (typeName.contains(".")) {
    return typeName;
  }
  for (Import i : model.getImports().getImports()) {
    if (i.getType().endsWith(typeName)) {
      return i.getType();
    }
  }
  final String packageName = model.getPackageName();
  return (!(packageName == null || packageName.isEmpty()) ? packageName + "." + typeName : typeName);
}

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

private String getFullyQualifiedClassName(final String typeName) {
  if (typeName.contains(".")) {
    return typeName;
  }
  for (Import i : model.getImports().getImports()) {
    if (i.getType().endsWith(typeName)) {
      return i.getType();
    }
  }
  final String packageName = model.getPackageName();
  return (!(packageName == null || packageName.isEmpty()) ? packageName + "." + typeName : typeName);
}

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

private String getFullyQualifiedClassName(final String typeName) {
    if (typeName.contains(".")) {
      return typeName;
    }

    for (Import i : model.getImports().getImports()) {
      if (i.getType().endsWith(typeName)) {
        return i.getType();
      }
    }
    final String packageName = model.getPackageName();
    return (!(packageName == null || packageName.isEmpty()) ? packageName + "." + typeName : typeName);
  }
}

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

private String getFullyQualifiedClassName(final String typeName) {
    if (typeName.contains(".")) {
      return typeName;
    }

    for (Import i : model.getImports().getImports()) {
      if (i.getType().endsWith(typeName)) {
        return i.getType();
      }
    }
    final String packageName = model.getPackageName();
    return (!(packageName == null || packageName.isEmpty()) ? packageName + "." + typeName : typeName);
  }
}

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

private void visit(final Imports imports) {
  for (Import imp : imports.getImports()) {
    String impStr = imp.getType();
    if (!impStr.endsWith("*")) {
      addResourceReference(impStr,
                 ResourceType.JAVA);
    } else {
      logger.debug("Wildcard import encountered : '" + impStr + "'");
    }
  }
}

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

private List<String> getChosenImports() {
  final List<String> imports = new ArrayList<String>();
  for (Import imp : model.getImports().getImports()) {
    imports.add(imp.getType());
  }
  return imports;
}

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

private List<String> getChosenImports() {
  final List<String> imports = new ArrayList<String>();
  for (Import imp : model.getImports().getImports()) {
    imports.add(imp.getType());
  }
  return imports;
}

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

private void convertToFullyQualifiedClassName(final String factType) {
    if (factType.contains(".")) {
      fqcNames.add(factType);
      return;
    }
    String fullyQualifiedClassName = null;
    for (Import imp : scenario.getImports().getImports()) {
      if (imp.getType().endsWith(factType)) {
        fullyQualifiedClassName = imp.getType();
        break;
      }
    }
    if (fullyQualifiedClassName == null) {
      fullyQualifiedClassName = scenario.getPackageName() + "." + factType;
    }
    fqcNames.add(fullyQualifiedClassName);
  }
}

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

@Override
public ExternalDataObjectsItemPresenter setup(final Import import_,
                       final ExternalDataObjectsPresenter parentPresenter) {
  this.import_ = import_;
  this.parentPresenter = parentPresenter;
  view.init(this);
  view.setTypeName(import_.getType());
  return this;
}

代码示例来源:origin: org.kie.soup/kie-soup-project-datamodel-commons

@Test
public void testMultipleImportsContent() {
  final String content = ""
      + "import java.lang.String;\n"
      + "import java.lang.Double;\n";
  final Imports imports = ImportsParser.parseImports(content);
  assertNotNull(imports);
  assertEquals(2,
         imports.getImports().size());
  assertEquals("java.lang.String",
         imports.getImports().get(0).getType());
  assertEquals("java.lang.Double",
         imports.getImports().get(1).getType());
}

代码示例来源:origin: org.kie.soup/kie-soup-project-datamodel-commons

@Test
public void testSingleImportContent() {
  final String content = "import java.lang.String;";
  final Imports imports = ImportsParser.parseImports(content);
  assertNotNull(imports);
  assertEquals(1,
         imports.getImports().size());
  assertEquals("java.lang.String",
         imports.getImports().get(0).getType());
}

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

@Test
public void testOnImportRemoved() {
  final Imports imports = new Imports();
  imports.addImport(new Import("Internal1"));
  presenter.setContent(dmo,
             imports,
             false);
  presenter.onRemoveImport(new Import("Internal1"));
  assertEquals(0,
         imports.getImports().size());
  verify(dmo).filter();
  verify(importRemovedEvent,
      times(1)).fire(importRemovedEventCaptor.capture());
  assertEquals("Internal1",
         importRemovedEventCaptor.getValue().getImport().getType());
}

相关文章