Source:
<code>protected void extractPropertyDescriptor(Field field, Object defaultInstance) { DefaultPropertyDescriptor desc = new DefaultPropertyDescriptor(); PropertyHidden parameterHidden = field.getAnnotation(PropertyHidden.class); if (parameterHidden == null) { PropertyId propertyId = field.getAnnotation(PropertyId.class); desc.setId(propertyId != null ? propertyId.value() : field.getName()); desc.setPropertyType(field.getGenericType()); PropertyDisplayType displayTypeAnnotation = field.getAnnotation(PropertyDisplayType.class); Type displayType; if (displayTypeAnnotation != null) { displayType = displayTypeAnnotation.value(); } else { displayType = desc.getPropertyType(); } <START> desc.setDisplayType(displayType); <END> PropertyName parameterName = field.getAnnotation(PropertyName.class); desc.setName(parameterName != null ? parameterName.value() : desc.getId()); PropertyDescription parameterDescription = field.getAnnotation(PropertyDescription.class); desc.setDescription(parameterDescription != null ? parameterDescription.value() : desc.getId()); Map<Class, Annotation> annotations = new HashMap<>(); annotations.put(PropertyMandatory.class, field.getAnnotation(PropertyMandatory.class)); annotations.put(Deprecated.class, field.getAnnotation(Deprecated.class)); annotations.put(PropertyAdvanced.class, field.getAnnotation(PropertyAdvanced.class)); annotations.put(PropertyGroup.class, field.getAnnotation(PropertyGroup.class)); annotations.put(PropertyFeature.class, field.getAnnotation(PropertyFeature.class)); setCommonProperties(desc, annotations); if (defaultInstance != null) { try { desc.setDefaultValue(field.get(defaultInstance)); } catch (Exception e) { LOGGER.error( MessageFormat.format("Failed to get default property value from field {0} in class {1}", field.getName(), this.beanClass), e); } } desc.setField(field); this.parameterDescriptorMap.put(desc.getId(), desc); } }</code><technical_language>a bit of code duplication here, much, I put in a separate private method</technical_language>

Target:
protected void extractPropertyDescriptor(Field field, Object defaultInstance) { DefaultPropertyDescriptor desc = new DefaultPropertyDescriptor(); PropertyHidden parameterHidden = field.getAnnotation(PropertyHidden.class); if (parameterHidden == null) { PropertyId propertyId = field.getAnnotation(PropertyId.class); desc.setId(propertyId != null ? propertyId.value() : field.getName()); desc.setPropertyType(field.getGenericType()); PropertyName parameterName = field.getAnnotation(PropertyName.class); desc.setName(parameterName != null ? parameterName.value() : desc.getId()); PropertyDescription parameterDescription = field.getAnnotation(PropertyDescription.class); desc.setDescription(parameterDescription != null ? parameterDescription.value() : desc.getId()); Map<Class, Annotation> annotations = new HashMap<>(); COMMON_ANNOTATION_CLASSES.forEach(aClass -> annotations.put(aClass, field.getAnnotation(aClass)) ); setCommonProperties(desc, annotations); if (defaultInstance != null) { try { desc.setDefaultValue(field.get(defaultInstance)); } catch (Exception e) { LOGGER.error( MessageFormat.format("Failed to get default property value from field {0} in class {1}", field.getName(), this.beanClass), e); } } desc.setField(field); this.parameterDescriptorMap.put(desc.getId(), desc); } }