boolean (@NotNull PsiElement element) { if (!(element instanceof PsiModifierListOwner owner)) return false; if (!ADDITIONAL_ANNOTATIONS.isEmpty() && ADDITIONAL_ANNOTATIONS.contains(Deprecated.class.getName()) && element instanceof PsiDocCommentOwner && ((PsiDocCommentOwner)element).isDeprecated()) { return true; } if (element instanceof PsiClass) { String qualifiedName = ((PsiClass)element).getQualifiedName(); if (qualifiedName != null) { for (ClassPattern pattern : getPatterns()) { if (pattern.method.isEmpty() && isAcceptedByPattern((PsiClass)element, qualifiedName, pattern, new HashSet<>())) { return true; } } } } if (element instanceof PsiMethod) { PsiClass containingClass = ((PsiMethod)element).getContainingClass(); if (containingClass != null) { String qualifiedName = containingClass.getQualifiedName(); if (qualifiedName != null) { String name = ((PsiMethod)element).getName(); for (ClassPattern pattern : getPatterns()) { if (pattern.method.isEmpty()) continue; boolean acceptedName = name.equals(pattern.method); if (!acceptedName) { Pattern methodRegexp = pattern.getMethodRegexp(); acceptedName = methodRegexp != null && methodRegexp.matcher(name).matches(); } if (acceptedName && isAcceptedByPattern(containingClass, qualifiedName, pattern, new HashSet<>())) { return true; } } } } } Collection<String> defaultAdditionalAnnotations = getAdditionalAnnotations(); return AnnotationUtil.checkAnnotatedUsingPatterns(owner, ADDITIONAL_ANNOTATIONS) || AnnotationUtil.checkAnnotatedUsingPatterns(owner, defaultAdditionalAnnotations) || MetaAnnotationUtil.isMetaAnnotated(owner, ADDITIONAL_ANNOTATIONS) || MetaAnnotationUtil.isMetaAnnotated(owner, defaultAdditionalAnnotations); }