AllowedValues (@NotNull PsiModifierListOwner element, @Nullable PsiType type, @Nullable PsiElement context, @Nullable Set<? super PsiClass> visited) { PsiManager manager = element.getManager(); for (PsiAnnotation annotation : getAllAnnotations(element)) { if (type != null && MagicConstant.class.getName().equals(annotation.getQualifiedName())) { AllowedValues values = getAllowedValuesFromMagic(type, annotation, manager, context); if (values != null) return values; } PsiClass aClass = annotation.resolveAnnotationType(); if (aClass == null) continue; if (visited == null) { visited = new HashSet<>(); } if (!visited.add(aClass)) { continue; } AllowedValues values = getAllowedValues(aClass, type, context, visited); if (values != null) { return values; } } return parseBeanInfo(element, manager); }