PsiField (PsiClass psiClass, @NotNull String attrNameToFind) { for (PsiField psiField : psiClass.getAllFields()) { if (psiField.hasModifierProperty(PsiModifier.STATIC)) continue; if (attrNameToFind.equals(getAnnotationValue(psiField))) { return psiField; } } return null; }