當前位置: 首頁>>代碼示例>>Java>>正文


Java PsiMethod.EMPTY_ARRAY屬性代碼示例

本文整理匯總了Java中com.intellij.psi.PsiMethod.EMPTY_ARRAY屬性的典型用法代碼示例。如果您正苦於以下問題:Java PsiMethod.EMPTY_ARRAY屬性的具體用法?Java PsiMethod.EMPTY_ARRAY怎麽用?Java PsiMethod.EMPTY_ARRAY使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在com.intellij.psi.PsiMethod的用法示例。


在下文中一共展示了PsiMethod.EMPTY_ARRAY屬性的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getMethodsByName

@Override
@NotNull
public PsiMethod[] getMethodsByName(@NotNull String name, @NotNull GlobalSearchScope scope) {
  Merger<PsiMethod> merger = null;
  for (PsiShortNamesCache cache : myCaches) {
    PsiMethod[] methods = cache.getMethodsByName(name, scope);
    if (methods.length != 0) {
      if (merger == null) merger = new Merger<PsiMethod>();
      merger.add(methods);
    }
  }
  PsiMethod[] result = merger == null ? null : merger.getResult();
  return result == null ? PsiMethod.EMPTY_ARRAY : result;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:14,代碼來源:CompositeShortNamesCache.java

示例2: getMethodsByNameIfNotMoreThan

@Override
@NotNull
public PsiMethod[] getMethodsByNameIfNotMoreThan(@NonNls @NotNull final String name, @NotNull final GlobalSearchScope scope, final int maxCount) {
  Merger<PsiMethod> merger = null;
  for (PsiShortNamesCache cache : myCaches) {
    PsiMethod[] methods = cache.getMethodsByNameIfNotMoreThan(name, scope, maxCount);
    if (methods.length == maxCount) return methods;
    if (methods.length != 0) {
      if (merger == null) merger = new Merger<PsiMethod>();
      merger.add(methods);
    }
  }
  PsiMethod[] result = merger == null ? null : merger.getResult();
  return result == null ? PsiMethod.EMPTY_ARRAY : result;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:15,代碼來源:CompositeShortNamesCache.java

示例3: getMethodsByName

@NotNull
@Override
public PsiMethod[] getMethodsByName(@NonNls @NotNull String name, @NotNull GlobalSearchScope scope) {
  if (!myComponent.hasAnyDataBindingEnabledFacet()) {
    return PsiMethod.EMPTY_ARRAY;
  }
  List<PsiMethod> methods = myMethodsByNameCache.getValue().get(name);
  return filterByScope(methods, scope, PsiMethod.class, PsiMethod.EMPTY_ARRAY);
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:9,代碼來源:DataBindingShortNamesCache.java

示例4: getMethodsByNameIfNotMoreThan

@NotNull
@Override
public PsiMethod[] getMethodsByNameIfNotMoreThan(@NonNls @NotNull String name, @NotNull GlobalSearchScope scope, int maxCount) {
  if (!myComponent.hasAnyDataBindingEnabledFacet()) {
    return PsiMethod.EMPTY_ARRAY;
  }
  PsiMethod[] methods = getMethodsByName(name, scope);
  if (methods.length > maxCount) {
    return PsiMethod.EMPTY_ARRAY;
  }
  return methods;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:12,代碼來源:DataBindingShortNamesCache.java

示例5: getMethodsByName

@Override
@NotNull
public PsiMethod[] getMethodsByName(@NonNls @NotNull String name, @NotNull GlobalSearchScope scope) {
  final Collection<? extends PsiMethod> methods = StubIndex.getElements(GrMethodNameIndex.KEY, name, myProject,
                                                                        new GrSourceFilterScope(scope), GrMethod.class);
  final Collection<? extends PsiMethod> annMethods = StubIndex.getElements(GrAnnotationMethodNameIndex.KEY, name, myProject,
                                                                           new GrSourceFilterScope(scope),
                                                                           GrAnnotationMethod.class);
  if (methods.isEmpty() && annMethods.isEmpty()) return PsiMethod.EMPTY_ARRAY;
  return ArrayUtil.mergeCollections(annMethods, methods, PsiMethod.ARRAY_FACTORY);
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:11,代碼來源:GroovyShortNamesCache.java

示例6: createImplementationPrototypes

@NotNull
@Override
public PsiMethod[] createImplementationPrototypes(PsiClass inClass, PsiMethod method) throws IncorrectOperationException {
  if (!(inClass instanceof GrTypeDefinition && method instanceof GrTraitMethod)) return PsiMethod.EMPTY_ARRAY;

  final PsiClass containingClass = method.getContainingClass();
  PsiSubstitutor substitutor = inClass.isInheritor(containingClass, true) ? TypeConversionUtil.getSuperClassSubstitutor(containingClass, inClass, PsiSubstitutor.EMPTY)
                                                                          : PsiSubstitutor.EMPTY;
  return new GrMethod[]{GroovyOverrideImplementUtil.generateTraitMethodPrototype((GrTypeDefinition)inClass, (GrTraitMethod)method, substitutor)};
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:10,代碼來源:TraitMethodImplementor.java

示例7: checkSuperMethods

@NotNull
public static PsiMethod[] checkSuperMethods(@NotNull PsiMethod method, @NotNull String actionString, @NotNull Collection<PsiElement> ignore) {
  PsiClass aClass = method.getContainingClass();
  if (aClass == null) return new PsiMethod[]{method};

  final Collection<PsiMethod> superMethods = DeepestSuperMethodsSearch.search(method).findAll();
  superMethods.removeAll(ignore);

  if (superMethods.isEmpty()) {
    PsiMethod siblingSuperMethod = FindSuperElementsHelper.getSiblingInheritedViaSubClass(method);
    if (siblingSuperMethod != null) {
      superMethods.add(siblingSuperMethod);
    }
  }
  if (superMethods.isEmpty()) return new PsiMethod[]{method};


  Set<String> superClasses = new HashSet<String>();
  boolean superAbstract = false;
  boolean parentInterface = false;
  for (final PsiMethod superMethod : superMethods) {
    final PsiClass containingClass = superMethod.getContainingClass();
    superClasses.add(containingClass.getQualifiedName());
    final boolean isInterface = containingClass.isInterface();
    superAbstract |= isInterface || superMethod.hasModifierProperty(PsiModifier.ABSTRACT);
    parentInterface |= isInterface;
  }

  SuperMethodWarningDialog dialog =
      new SuperMethodWarningDialog(method.getProject(), DescriptiveNameUtil.getDescriptiveName(method), actionString, superAbstract,
                                   parentInterface, aClass.isInterface(), ArrayUtil.toStringArray(superClasses));
  dialog.show();

  if (dialog.getExitCode() == DialogWrapper.OK_EXIT_CODE) {
    return superMethods.toArray(new PsiMethod[superMethods.size()]);
  }
  if (dialog.getExitCode() == SuperMethodWarningDialog.NO_EXIT_CODE) {
    return new PsiMethod[]{method};
  }

  return PsiMethod.EMPTY_ARRAY;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:42,代碼來源:SuperMethodWarningUtil.java

示例8: getMethodsByName

@NotNull
@Override
public PsiMethod[] getMethodsByName(@NonNls @NotNull String name, @NotNull GlobalSearchScope scope) {
  return PsiMethod.EMPTY_ARRAY;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:5,代碼來源:BrShortNamesCache.java

示例9: getMethodsByNameIfNotMoreThan

@NotNull
@Override
public PsiMethod[] getMethodsByNameIfNotMoreThan(@NonNls @NotNull String name, @NotNull GlobalSearchScope scope, int maxCount) {
  return PsiMethod.EMPTY_ARRAY;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:5,代碼來源:BrShortNamesCache.java

示例10: getMethodsToImplement

@NotNull
@Override
public PsiMethod[] getMethodsToImplement(PsiClass aClass) {
  return PsiMethod.EMPTY_ARRAY;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:5,代碼來源:TraitMethodImplementor.java


注:本文中的com.intellij.psi.PsiMethod.EMPTY_ARRAY屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。