void (PsiField field, DomExtensionsRegistrar registrar, PsiAnnotation collectionAnnotation, ExtensionPointBinding.BindingVisitor.RequiredFlag required) { final boolean surroundWithTag = PsiUtil.getAnnotationBooleanAttribute(collectionAnnotation, "surroundWithTag"); if (surroundWithTag) return; // todo Set, List, Array final String tagName = PsiUtil.getAnnotationStringAttribute(collectionAnnotation, "elementTag", null); final String attrName = PsiUtil.getAnnotationStringAttribute(collectionAnnotation, "elementValueAttribute", null); final PsiType elementType = getElementType(field.getType()); if (elementType == null || TypeConversionUtil.isPrimitiveAndNotNullOrWrapper(elementType) || CommonClassNames.JAVA_LANG_STRING.equals(elementType.getCanonicalText()) || TypeConversionUtil.isEnumType(elementType)) { if (tagName != null && attrName == null) { final DomExtension extension = registrar .registerCollectionChildrenExtension(new XmlName(tagName), SimpleTagValue.class) .setDeclaringElement(field); markAsRequired(extension, required); } else if (tagName != null) { final DomExtension extension = registrar .registerCollectionChildrenExtension(new XmlName(tagName), DomElement.class) .setDeclaringElement(field); markAsRequired(extension, required); extension.addExtender(new DomExtender() { @Override public void registerExtensions(@NotNull DomElement domElement, @NotNull DomExtensionsRegistrar registrar) { registrar.registerGenericAttributeValueChildExtension(new XmlName(attrName), String.class); } }); } } else { final PsiClass elementPsiClass = PsiTypesUtil.getPsiClass(elementType); if (elementPsiClass != null) { final PsiModifierList modifierList = elementPsiClass.getModifierList(); final PsiAnnotation tagAnno = modifierList == null ? null : modifierList.findAnnotation(Tag.class.getName()); final String classTagName = tagAnno == null ? elementPsiClass.getName() : PsiUtil.getAnnotationStringAttribute(tagAnno, "value", null); if (classTagName != null) { final DomExtension extension = registrar .registerCollectionChildrenExtension(new XmlName(classTagName), DomElement.class) .setDeclaringElement(field); markAsRequired(extension, required); extension.addExtender(new DomExtender() { @Override public void registerExtensions(@NotNull DomElement domElement, @NotNull DomExtensionsRegistrar registrar) { registerXmlb(registrar, elementPsiClass, Collections.emptyList()); } }); } } } }