private boolean verifyLombokAnnotationPresent(@NotNull PsiClass psiClass) { if (PsiAnnotationUtil.checkAnnotationsSimpleNameExistsIn(psiClass, registeredAnnotationNames)) { return true; } Collection<PsiField> psiFields = PsiClassUtil.collectClassFieldsIntern(psiClass); for (PsiField psiField : psiFields) { if (PsiAnnotationUtil.checkAnnotationsSimpleNameExistsIn( psiField, registeredAnnotationNames)) { return true; } } Collection<PsiMethod> psiMethods = PsiClassUtil.collectClassMethodsIntern(psiClass); for (PsiMethod psiMethod : psiMethods) { if (PsiAnnotationUtil.checkAnnotationsSimpleNameExistsIn( psiMethod, registeredAnnotationNames)) { return true; } } final PsiElement psiClassParent = psiClass.getParent(); if (psiClassParent instanceof PsiClass) { return verifyLombokAnnotationPresent((PsiClass) psiClassParent); } return false; }
@NotNull public Collection<PsiAnnotation> collectProcessedAnnotations(@NotNull PsiClass psiClass) { List<PsiAnnotation> result = new ArrayList<PsiAnnotation>(); for (PsiMethod psiMethod : PsiClassUtil.collectClassMethodsIntern(psiClass)) { PsiAnnotation psiAnnotation = PsiAnnotationUtil.findAnnotation(psiMethod, getSupportedAnnotation()); if (null != psiAnnotation) { result.add(psiAnnotation); } } return result; }
@NotNull @Override public List<? super PsiElement> process(@NotNull PsiClass psiClass) { List<? super PsiElement> result = new ArrayList<PsiElement>(); for (PsiMethod psiMethod : PsiClassUtil.collectClassMethodsIntern(psiClass)) { PsiAnnotation psiAnnotation = PsiAnnotationUtil.findAnnotation(psiMethod, getSupportedAnnotation()); if (null != psiAnnotation) { if (validate(psiAnnotation, psiMethod, ProblemEmptyBuilder.getInstance())) { processIntern(psiMethod, psiAnnotation, result); } } } return result; }