void (BindingVisitor visitor) { boolean hasClassLevelPropertyAnnotation = hasClassLevelPropertyAnnotation(); for (PsiField field : myPsiClass.getAllFields()) { if (field.hasModifierProperty(PsiModifier.STATIC)) continue; final PsiMethod getter = PropertyUtilBase.findGetterForField(field); final PsiMethod setter = PropertyUtilBase.findSetterForField(field); if ((getter == null || setter == null) && !field.hasModifierProperty(PsiModifier.PUBLIC)) continue; final PsiAnnotation requiredAnnotation = PsiUtil.findAnnotation(RequiredElement.class, field, getter, setter); BindingVisitor.RequiredFlag required = BindingVisitor.RequiredFlag.NOT_REQUIRED; if (requiredAnnotation != null) { required = PsiUtil.getAnnotationBooleanAttribute(requiredAnnotation, "allowEmpty") ? BindingVisitor.RequiredFlag.REQUIRED_ALLOW_EMPTY : BindingVisitor.RequiredFlag.REQUIRED; } final PsiAnnotation attributeAnnotation = PsiUtil.findAnnotation(Attribute.class, field, getter, setter); if (attributeAnnotation != null) { String fieldName = PsiUtil.getAnnotationStringAttribute(attributeAnnotation, "value", field.getName()); if (fieldName != null) { visitor.visitAttribute(field, fieldName, required); } } else if (hasClassLevelPropertyAnnotation) { visitor.visitAttribute(field, field.getName(), required); } else { final PsiAnnotation tagAnno = PsiUtil.findAnnotation(Tag.class, field, getter, setter); final PsiAnnotation collectionAnnotation = PsiUtil.findAnnotation(XCollection.class, field, getter, setter); //final PsiAnnotation colAnno = modifierList.findAnnotation(Collection.class.getName()); // todo String fieldName = field.getName(); final String tagName; if (tagAnno != null) { tagName = PsiUtil.getAnnotationStringAttribute(tagAnno, "value", fieldName); } else { final PsiAnnotation propAnno = PsiUtil.findAnnotation(Property.class, field, getter, setter); tagName = propAnno != null && PsiUtil.getAnnotationBooleanAttribute(propAnno, "surroundWithTag") ? Constants.OPTION : null; } if (tagName != null && collectionAnnotation == null) { visitor.visitTagOrProperty(field, tagName, required); } else if (collectionAnnotation != null) { visitor.visitXCollection(field, tagName, collectionAnnotation, required); } } } }