void (@NotNull PsiField field, @NotNull @NonNls String attributeName, RequiredFlag required) { final With withElement = findWithElement(elements, field); final PsiType fieldType = field.getType(); Class<?> clazz = String.class; if (PsiTypes.booleanType().equals(fieldType)) { clazz = Boolean.class; } else if (PsiTypes.intType().equals(fieldType) || fieldType.equalsToText(CommonClassNames.JAVA_LANG_INTEGER)) { clazz = Integer.class; } else if (withElement != null || Extension.isClassField(attributeName)) { clazz = PsiClass.class; } final DomExtension extension = registrar.registerGenericAttributeValueChildExtension(new XmlName(attributeName), clazz).setDeclaringElement(field); markAsRequired(extension, required); if (clazz == String.class) { markStringProperty(extension, field, fieldType, attributeName); } else if (clazz == PsiClass.class) { markAsClass(extension, true, withElement); } }