Package io.micronaut.inject.annotation
Interface AnnotationMapper<T extends Annotation>
- Type Parameters:
T
- The annotation type
- All Known Subinterfaces:
NamedAnnotationMapper
,TypedAnnotationMapper<T>
- All Known Implementing Classes:
EntityIntrospectedAnnotationMapper
,EntityReflectiveAccessAnnotationMapper
,InterceptorBeanMapper
,JakartaEntityIntrospectedAnnotationMapper
,JakartaMappedSuperClassIntrospectionMapper
,JakartaPersistenceContextAnnotationMapper
,JavaxPersistenceContextAnnotationMapper
,JsonCreatorAnnotationMapper
,MappedSuperClassIntrospectionMapper
,MapperAnnotationMapper
public interface AnnotationMapper<T extends Annotation>
An
AnnotationMapper
is a type that is capable of mapping a given annotation to one or many annotations at compile time.
Use cases include if you wish to support different annotation types or specifications but wish to map them a common internal annotation annotation.
For example to support the JPA spec you may wish to map the PersistenceContext
annotation to one or many other internal annotations with relying specifically on the JPA specification.
AnnotationMapper instances can be registered with the service loader pattern via META-INF/services
and will be picked up at compile time and should implement
either NamedAnnotationMapper
or TypedAnnotationMapper
- Since:
- 1.0
- Author:
- graemerocher
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionList<AnnotationValue<?>>
map
(AnnotationValue<T> annotation, VisitorContext visitorContext) The map method will be called for each instances of the annotation returned via this method.
-
Method Details
-
map
The map method will be called for each instances of the annotation returned via this method.- Parameters:
annotation
- The annotation valuesvisitorContext
- The context that is being visited- Returns:
- A list of zero or many annotations and values to map to
-