コード例 #1
0
 @NotNull
 public static PsiMethod[] getConstructors(@NotNull PsiClass aClass) {
   List<PsiMethod> result = null;
   for (PsiMethod method : aClass.getMethods()) {
     if (method.isConstructor()) {
       if (result == null) result = ContainerUtil.newSmartList();
       result.add(method);
     }
   }
   return result == null ? PsiMethod.EMPTY_ARRAY : result.toArray(new PsiMethod[result.size()]);
 }
コード例 #2
0
 public static boolean processDeclarationsInMethod(
     @NotNull final PsiMethod method,
     @NotNull final PsiScopeProcessor processor,
     @NotNull final ResolveState state,
     final PsiElement lastParent,
     @NotNull final PsiElement place) {
   final boolean fromBody = lastParent instanceof PsiCodeBlock;
   final PsiTypeParameterList typeParameterList = method.getTypeParameterList();
   return processDeclarationsInMethodLike(
       method, processor, state, place, fromBody, typeParameterList);
 }
コード例 #3
0
 public static boolean isVarArgs(@NotNull PsiMethod method) {
   PsiParameter[] parameters = method.getParameterList().getParameters();
   return parameters.length > 0 && parameters[parameters.length - 1].isVarArgs();
 }