-
Notifications
You must be signed in to change notification settings - Fork 38.8k
Closed
Labels
type: wiki-documentationA documentation update required on the wikiA documentation update required on the wiki
Description
Sam Brannen opened SPR-11515 and commented
Status Quo
Over the past several releases, the Spring Framework has continually enhanced its support for meta-annotations and custom composed annotations, potentially with meta-annotation attribute overrides. However, the programming model is not clearly documented in the reference manual. Furthermore, new features for annotation attribute aliases and meta-annotation support have been introduced in 4.2, and these will need to be clearly documented as well.
Deliverables
In the Spring Framework Wiki, introduce a new page covering all features of Spring's support for meta-annotations, including but not limited to the following.
- Document the general search algorithm(s) for annotations and meta-annotations on classes, interfaces, methods, and annotations.
- What happens if an annotation is present on an element both locally and as a meta-annotation?
- How does the presence of
@Inheritedon an annotation (including custom composed annotations) affect the search algorithm?
- Document support for annotation attribute aliases configured via
@AliasFor.- How does one declare that an attribute is an alias for another attribute within the same annotation?
- What happens if an attribute and its alias are declared in an annotation instance (with the same value or with different values)?
- The presumed behavior is that an
AnnotationConfigurationExceptionwill be thrown. - See Introduce unified support for declaring and looking up annotation attribute aliases [SPR-11512] #16137.
- The presumed behavior is that an
- See Introduce aliases for 'value' annotation attributes [SPR-11393] #16020.
- Document support for composed annotations.
- Document support for meta-annotation attribute overrides in composed annotations.
- Document the algorithm used when looking up attributes, specifically explaining:
- implicit mapping based on naming convention (i.e., composed annotation declares an attribute with the exact same name and type as declared in the overridden meta-annotation)
- explicit mapping using the annotation-based mechanism introduced in Introduce support for explicit annotation attribute overrides [SPR-11513] #16138
- What happens if an attribute and one of its aliases are declared somewhere within the annotation hierarchy? Which one takes precedence?
- In general, how are conflicts involving annotation attributes resolved?
- Document the algorithm used when looking up attributes, specifically explaining:
- Document the special handling of the
valueattribute for@Componentand@Qualifier, or cross reference existing documentation as appropriate.
Annotations Using @AliasFor as of Spring Framework 4.2
org.springframework.cache.annotation.Cacheableorg.springframework.cache.annotation.CacheEvictorg.springframework.cache.annotation.CachePutorg.springframework.context.annotation.ComponentScan.Filterorg.springframework.context.annotation.ComponentScanorg.springframework.context.annotation.ImportResourceorg.springframework.context.annotation.Scopeorg.springframework.context.event.EventListenerorg.springframework.jmx.export.annotation.ManagedResourceorg.springframework.messaging.handler.annotation.Headerorg.springframework.messaging.handler.annotation.Payloadorg.springframework.messaging.simp.annotation.SendToUserorg.springframework.test.context.ActiveProfilesorg.springframework.test.context.ContextConfigurationorg.springframework.test.context.jdbc.Sqlorg.springframework.test.context.TestExecutionListenersorg.springframework.test.context.TestPropertySourceorg.springframework.transaction.annotation.Transactionalorg.springframework.transaction.event.TransactionalEventListenerorg.springframework.web.bind.annotation.ControllerAdviceorg.springframework.web.bind.annotation.CookieValueorg.springframework.web.bind.annotation.CrossOriginorg.springframework.web.bind.annotation.MatrixVariableorg.springframework.web.bind.annotation.RequestHeaderorg.springframework.web.bind.annotation.RequestMappingorg.springframework.web.bind.annotation.RequestParamorg.springframework.web.bind.annotation.RequestPartorg.springframework.web.bind.annotation.ResponseStatusorg.springframework.web.bind.annotation.SessionAttributesorg.springframework.web.portlet.bind.annotation.ActionMappingorg.springframework.web.portlet.bind.annotation.RenderMapping
Affects: 4.0 GA
Issue Links:
- Introduce unified support for declaring and looking up annotation attribute aliases [SPR-11512] #16137 Introduce unified support for declaring and looking up annotation attribute aliases ("depends on")
- Introduce support for explicit annotation attribute overrides [SPR-11513] #16138 Introduce support for explicit annotation attribute overrides ("depends on")
- Introduce aliases for 'value' annotation attributes [SPR-11393] #16020 Introduce aliases for 'value' annotation attributes ("depends on")
- Introduce predefined composed annotations in core Spring [SPR-13442] #18022 Introduce predefined composed annotations in core Spring
- Introduce a comprehensive programming model for meta-annotation support [SPR-11511] #16136 Introduce a comprehensive programming model for meta-annotation support
- Use AnnotatedElementUtils instead of AnnotationUtils wherever feasible [SPR-13440] #18020 Use AnnotatedElementUtils instead of AnnotationUtils wherever feasible
- Update Spring Annotation Programming Model to reflect status quo [SPR-16575] #21117 Update Spring Annotation Programming Model to reflect status quo
0 votes, 6 watchers
Metadata
Metadata
Assignees
Labels
type: wiki-documentationA documentation update required on the wikiA documentation update required on the wiki