T
- The annotation typepublic interface AnnotationMapper<T extends Annotation>
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
NamedAnnotationMapper
,
TypedAnnotationMapper
Modifier and Type | Method and Description |
---|---|
List<AnnotationValue<?>> |
map(AnnotationValue<T> annotation,
VisitorContext visitorContext)
The map method will be called for each instances of the annotation returned via this method.
|
List<AnnotationValue<?>> map(AnnotationValue<T> annotation, VisitorContext visitorContext)
annotation
- The annotation valuesvisitorContext
- The context that is being visited