Interface Annotations


  • public interface Annotations
    • Method Detail

      • get

        <T extends AnnotationOptional<T> get​(Class<T> type)
        Get the 'strongest' Annotation instance of this type. Multiple annotations may be applicable, e.g. from several mixins or stereotypes. The annotation will be picked in this order:
        1. mixin
        2. target
        3. target stereotypes
        4. containing class
        5. containing class stereotypes
        6. containing package (TODO not yet implemented)
        7. containing package stereotypes (TODO not yet implemented)
        If this order not sufficiently defined, e.g. because there are multiple repeatable annotations, or because there are multiple mixins or stereotypes with the same annotation, an AmbiguousAnnotationResolutionException is thrown. I.e. when an annotation is changed to be repeatable, all frameworks using this annotation will have to use all(Class) instead (of course), but the semantics for the client code changes, which may break existing code.