Beispiel #1
0
  @Nullable
  @IfNotParsed
  public static ImportPath getImportPath(@NotNull JetImportDirective importDirective) {
    if (PsiTreeUtil.hasErrorElements(importDirective)) {
      return null;
    }

    FqName importFqn = getFQName(importDirective.getImportedReference());
    if (importFqn == null) {
      return null;
    }

    Name alias = null;
    String aliasName = importDirective.getAliasName();
    if (aliasName != null) {
      alias = Name.identifier(aliasName);
    }

    return new ImportPath(importFqn, importDirective.isAllUnder(), alias);
  }