Java 类com.intellij.psi.scope.DelegatingScopeProcessor 实例源码

项目:tools-idea    文件:GdkMethodUtil.java   
/**
 *
 * @param place - context of processing
 * @param processor - processor to use
 * @param categoryClass - category class to process
 * @return
 */
public static boolean processCategoryMethods(final PsiElement place,
                                             final PsiScopeProcessor processor,
                                             @NotNull final ResolveState state,
                                             @NotNull final PsiClass categoryClass) {
  final DelegatingScopeProcessor delegate = new DelegatingScopeProcessor(processor) {
    @Override
    public boolean execute(@NotNull PsiElement element, ResolveState delegateState) {
      if (element instanceof PsiMethod && isCategoryMethod((PsiMethod)element, null, null, null)) {
        PsiMethod method = (PsiMethod)element;
        return processor.execute(GrGdkMethodImpl.createGdkMethod(method, false, generateOriginInfo(method)), delegateState);
      }
      return true;
    }
  };
  return categoryClass.processDeclarations(delegate, state, null, place);
}