Package io.micronaut.inject.annotation
Interface AnnotationMapper<T extends java.lang.annotation.Annotation>
-
- Type Parameters:
T
- The annotation type
- All Known Subinterfaces:
NamedAnnotationMapper
,TypedAnnotationMapper<T>
- All Known Implementing Classes:
EntityIntrospectedAnnotationMapper
,EntityReflectiveAccessAnnotationMapper
,JakartaEntityIntrospectedAnnotationMapper
,JakartaMappedSuperClassIntrospectionMapper
,JsonCreatorAnnotationMapper
,MappedSuperClassIntrospectionMapper
,PersistenceContextAnnotationMapper
,TimedAnnotationMapper
public interface AnnotationMapper<T extends java.lang.annotation.Annotation>
AnAnnotationMapper
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 eitherNamedAnnotationMapper
orTypedAnnotationMapper
- Since:
- 1.0
- See Also:
NamedAnnotationMapper
,TypedAnnotationMapper
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.util.List<io.micronaut.core.annotation.AnnotationValue<?>>
map(io.micronaut.core.annotation.AnnotationValue<T> annotation, VisitorContext visitorContext)
The map method will be called for each instances of the annotation returned via this method.
-
-
-
Method Detail
-
map
java.util.List<io.micronaut.core.annotation.AnnotationValue<?>> map(io.micronaut.core.annotation.AnnotationValue<T> annotation, VisitorContext visitorContext)
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
-
-