Class JakartaPriorityAnnotationMapper
- All Implemented Interfaces:
Named, AnnotationMapper<Annotation>, NamedAnnotationMapper
The value is mapped across unchanged: @Priority(10) becomes @Order(10). Both
annotations sort the lowest value first, which is the convention Jakarta Interceptors and Jakarta
RESTful Web Services use for the priorities they define, so the mapped order means the same thing
as the source annotation for those. jakarta.annotation.Priority itself leaves the
direction to the specification that consumes it, and a consumer following one that prefers the
highest value instead (the selection of a CDI alternative, for example) has to negate the
value it reads.
An annotation mapper adds to what it reads rather than replacing it, so
jakarta.annotation.Priority is still present in the metadata after mapping and
metadata.intValue("jakarta.annotation.Priority") still returns the value as written. Code
that needs the priority exactly as the author declared it can read the source annotation directly
instead of going through Order.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetName()List<AnnotationValue<?>> map(AnnotationValue<Annotation> annotation, VisitorContext visitorContext) The map method will be called for each instances of the annotation returned via this method.
-
Constructor Details
-
JakartaPriorityAnnotationMapper
public JakartaPriorityAnnotationMapper()
-
-
Method Details
-
getName
-
map
public List<AnnotationValue<?>> map(AnnotationValue<Annotation> annotation, VisitorContext visitorContext) Description copied from interface:AnnotationMapperThe map method will be called for each instances of the annotation returned via this method.- Specified by:
mapin interfaceAnnotationMapper<Annotation>- Parameters:
annotation- The annotation valuesvisitorContext- The context that is being visited- Returns:
- A list of zero or many annotations and values to map to
-