PsiAnnotation (PsiMember clazz, String annotName) { if (annotName == null) return null; final PsiModifierList list = clazz.getModifierList(); if (list == null) return null; for (PsiAnnotation annotation : list.getAnnotations()) { if (annotName.equals(annotation.getQualifiedName())) return annotation; } return null; }