Class JakartaPriorityAnnotationMapper

java.lang.Object
io.micronaut.inject.annotation.internal.JakartaPriorityAnnotationMapper
All Implemented Interfaces:
Named, AnnotationMapper<Annotation>, NamedAnnotationMapper

@Internal public final class JakartaPriorityAnnotationMapper extends Object implements NamedAnnotationMapper
Maps Jakarta's priority annotation to Micronaut's order annotation.

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 Details

    • JakartaPriorityAnnotationMapper

      public JakartaPriorityAnnotationMapper()
  • Method Details