本文整理匯總了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;
}
示例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;
}
示例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);
}
示例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;
}
示例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);
}
示例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)};
}
示例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;
}
示例8: getMethodsByName
@NotNull
@Override
public PsiMethod[] getMethodsByName(@NonNls @NotNull String name, @NotNull GlobalSearchScope scope) {
return PsiMethod.EMPTY_ARRAY;
}
示例9: getMethodsByNameIfNotMoreThan
@NotNull
@Override
public PsiMethod[] getMethodsByNameIfNotMoreThan(@NonNls @NotNull String name, @NotNull GlobalSearchScope scope, int maxCount) {
return PsiMethod.EMPTY_ARRAY;
}
示例10: getMethodsToImplement
@NotNull
@Override
public PsiMethod[] getMethodsToImplement(PsiClass aClass) {
return PsiMethod.EMPTY_ARRAY;
}