Class ProvidedClassifier


  • public class ProvidedClassifier
    extends java.lang.Object
    Determines what Class types an AnnotatedElement provides. Built in support for the Provides annotation
    Since:
    19.3.0
    Author:
    cdivilly
    • Method Detail

      • provides

        public java.util.Set<TypeQualifier<?>> provides​(java.lang.reflect.AnnotatedElement element)
        Determines the services that the specified annotation site provides
        Parameters:
        element - The annotation site to examine
        Returns:
        Set of TypeQualifier instances indicating the services the annotation site provides
      • provides

        public java.util.Set<TypeQualifier<?>> provides​(AnnotationSet annotations)
        Determines the services that the specified AnnotationSet provides. These can be either be explicitly enumerated via Provides.value() or inferred as follows:

        AnnotationSet for a Type

        • In the first instance all interfaces explicitly implemented by the type are assumed to be the provided services
        • In the second instance iff the immediate super class is abstract then that superclass is assumed to be the provided service
        • In the third instance the actual type is assumed to be the service, i.e. the type provides itself as a service

        AnnotationSet for a Field

        • The declared type of the field
        Parameters:
        annotations - The AnnotationSet to be examined
        Returns:
        Set of TypeQualifier instances indicating the services the type provides
      • provides

        public java.util.Set<TypeQualifier<?>> provides​(java.lang.Class<?> type)
        Determines the services that the specified type provides. These can be either be explicitly enumerated via Provides.value() or inferred as follows:
        • In the first instance all interfaces explicitly implemented by the type are assumed to be the provided services
        • In the second instance iff the immediate super class is abstract then that superclass is assumed to be the provided service
        • In the third instance the actual type is assumed to be the service, i.e. the type provides itself as a service
        Parameters:
        type - The type to be examined
        Returns:
        Set of TypeQualifier instances indicating the services the type provides
      • provides

        public java.util.Set<TypeQualifier<?>> provides​(java.lang.reflect.Field field)
                                                 throws java.lang.IllegalArgumentException
        Determines the services a constant field provides
        Parameters:
        field - The field to be examined, must be a static final field
        Returns:
        Set of TypeQualifier instances indicating the services the field provides
        Throws:
        java.lang.IllegalArgumentException - if the field is not a static final field