Allow annotation to be synthesized from a map with minimal attributes [SPR-13087] #17678
Closed
1 task done
Labels
in: core
Issues in core modules (aop, beans, core, context, expression)
type: enhancement
A general enhancement
Milestone
Sam Brannen opened SPR-13087 and commented
Status Quo
#17659 introduced support for synthesizing an annotation from a
Map
(orAnnotationAttributes
). This initial support also validates the supplied map and requires that it "must contain key-value pairs for every attribute defined by the suppliedannotationType
."The validation that
MapAnnotationAttributeExtractor
currently performs was implemented in order to support Spring's internal use case of synthesizing an annotation from mergedAnnotationAttributes
(as created byAnnotatedElementUtils
), and for that use case it is in fact an error if any attributes defined by the annotation are not present (including aliased attributes).However, there are use cases that would benefit from being able to supply a reduced set of attributes and still have the annotation synthesized properly. See the discussion in this Spring Integration pull request for an example.
Deliverables
MapAnnotationAttributeExtractor
so that a reduced set of attributes may be supplied.Affects: 4.2 RC2
Issue Links:
Referenced from: commits d0c0d9f, ece12f9
The text was updated successfully, but these errors were encountered: