Polishing
This commit is contained in:
parent
d22480b0eb
commit
744350a262
|
|
@ -1079,12 +1079,10 @@ public class AnnotatedElementUtils {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void overrideAttributes(AnnotatedElement element, Annotation annotation, AnnotationAttributes attributes,
|
private void overrideAttributes(AnnotatedElement element, Annotation annotation,
|
||||||
String sourceAttributeName, List<String> targetAttributeNames) {
|
AnnotationAttributes attributes, String sourceAttributeName, List<String> targetAttributeNames) {
|
||||||
|
|
||||||
Object value = AnnotationUtils.getValue(annotation, sourceAttributeName);
|
Object adaptedValue = getAdaptedValue(element, annotation, sourceAttributeName);
|
||||||
Object adaptedValue = AnnotationUtils.adaptValue(element, value, this.classValuesAsString,
|
|
||||||
this.nestedAnnotationsAsMap);
|
|
||||||
|
|
||||||
for (String targetAttributeName : targetAttributeNames) {
|
for (String targetAttributeName : targetAttributeNames) {
|
||||||
attributes.put(targetAttributeName, adaptedValue);
|
attributes.put(targetAttributeName, adaptedValue);
|
||||||
|
|
@ -1094,10 +1092,12 @@ public class AnnotatedElementUtils {
|
||||||
private void overrideAttribute(AnnotatedElement element, Annotation annotation, AnnotationAttributes attributes,
|
private void overrideAttribute(AnnotatedElement element, Annotation annotation, AnnotationAttributes attributes,
|
||||||
String sourceAttributeName, String targetAttributeName) {
|
String sourceAttributeName, String targetAttributeName) {
|
||||||
|
|
||||||
|
attributes.put(targetAttributeName, getAdaptedValue(element, annotation, sourceAttributeName));
|
||||||
|
}
|
||||||
|
|
||||||
|
private Object getAdaptedValue(AnnotatedElement element, Annotation annotation, String sourceAttributeName) {
|
||||||
Object value = AnnotationUtils.getValue(annotation, sourceAttributeName);
|
Object value = AnnotationUtils.getValue(annotation, sourceAttributeName);
|
||||||
Object adaptedValue = AnnotationUtils.adaptValue(element, value, this.classValuesAsString,
|
return AnnotationUtils.adaptValue(element, value, this.classValuesAsString, this.nestedAnnotationsAsMap);
|
||||||
this.nestedAnnotationsAsMap);
|
|
||||||
attributes.put(targetAttributeName, adaptedValue);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue