public static AccessorsInfo build(@NotNull PsiField psiField) {
final PsiAnnotation accessorsFieldAnnotation = AnnotationUtil.findAnnotation(psiField, ACCESSORS_ANNOTATION_NAME);
if (null != accessorsFieldAnnotation) {
return buildFromAnnotation(accessorsFieldAnnotation);
} else {
PsiClass containingClass = psiField.getContainingClass();
while (null != containingClass) {
final PsiAnnotation accessorsClassAnnotation = AnnotationUtil.findAnnotation(containingClass, ACCESSORS_ANNOTATION_NAME);
if (null != accessorsClassAnnotation) {
return buildFromAnnotation(accessorsClassAnnotation);
}
containingClass = containingClass.getContainingClass();
}
}
return new AccessorsInfo();
}