Class AbstractProviderDefinition<T>

    • Field Summary

      • Fields inherited from interface io.micronaut.core.annotation.AnnotationMetadata

        CLASS_NAME_SUFFIX, EMPTY_METADATA, VALUE_MEMBER
      • Fields inherited from interface io.micronaut.core.annotation.AnnotationSource

        EMPTY
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      T build​(BeanResolutionContext resolutionContext, BeanContext context, BeanDefinition<T> definition)
      Builds a bean instance.
      protected abstract T buildProvider​(BeanResolutionContext resolutionContext, BeanContext context, io.micronaut.core.type.Argument<java.lang.Object> argument, Qualifier<java.lang.Object> qualifier, boolean singleton)
      Builds a provider implementation.
      boolean equals​(java.lang.Object o)  
      io.micronaut.core.annotation.AnnotationMetadata getAnnotationMetadata()  
      java.lang.String getBeanDefinitionName()  
      Qualifier<T> getDeclaredQualifier()
      Resolve the declared qualifier for this bean.
      java.util.List<io.micronaut.core.type.Argument<?>> getTypeArguments()
      If the bean itself declares any type arguments this method will return the classes that represent those types.
      java.util.List<io.micronaut.core.type.Argument<?>> getTypeArguments​(java.lang.Class<?> type)
      Return the type arguments for the given interface or super type for this bean.
      int hashCode()  
      boolean isAbstract()  
      protected boolean isAllowEmptyProviders​(BeanContext context)
      Return whether missing providers are allowed for this implementation.
      boolean isContainerType()
      Checks whether the bean type is a container type.
      boolean isEnabled​(BeanContext context, BeanResolutionContext resolutionContext)
      Return whether this component is enabled for the given context.
      boolean isPresent()  
      boolean isSingleton()  
      BeanDefinition<T> load()
      Loads the bean definition.
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface io.micronaut.core.annotation.AnnotationMetadata

        getAnnotationValuesByName, getAnnotationValuesByStereotype, getDeclaredAnnotationValuesByName, getValues, hasDeclaredStereotype, isAnnotationPresent, isDeclaredAnnotationPresent
      • Methods inherited from interface io.micronaut.core.annotation.AnnotationMetadataDelegate

        booleanValue, booleanValue, booleanValue, booleanValue, classValue, classValue, classValue, classValue, classValues, classValues, classValues, classValues, doubleValue, doubleValue, doubleValue, enumValue, enumValue, enumValue, enumValue, enumValues, enumValues, enumValues, enumValues, findAnnotation, findAnnotation, findDeclaredAnnotation, findDeclaredAnnotation, findRepeatableAnnotation, findRepeatableAnnotation, getAnnotation, getAnnotation, getAnnotationNameByStereotype, getAnnotationNameByStereotype, getAnnotationNames, getAnnotationNamesByStereotype, getAnnotationNamesByStereotype, getAnnotationType, getAnnotationType, getAnnotationTypeByStereotype, getAnnotationTypeByStereotype, getAnnotationTypesByStereotype, getAnnotationTypesByStereotype, getAnnotationTypesByStereotype, getAnnotationValuesByType, getDeclaredAnnotation, getDeclaredAnnotation, getDeclaredAnnotationNameByStereotype, getDeclaredAnnotationNames, getDeclaredAnnotationNamesByStereotype, getDeclaredAnnotationTypeByStereotype, getDeclaredAnnotationTypeByStereotype, getDeclaredAnnotationValuesByType, getDeclaredMetadata, getDeclaredStereotypeAnnotationNames, getDefaultValue, getDefaultValue, getDefaultValue, getDefaultValue, getDefaultValues, getStereotypeAnnotationNames, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValues, getValues, hasAnnotation, hasAnnotation, hasDeclaredAnnotation, hasDeclaredAnnotation, hasDeclaredStereotype, hasDeclaredStereotype, hasDeclaredStereotype, hasPropertyExpressions, hasSimpleAnnotation, hasSimpleDeclaredAnnotation, hasStereotype, hasStereotype, hasStereotype, hasStereotype, intValue, intValue, intValue, isAnnotationPresent, isDeclaredAnnotationPresent, isEmpty, isFalse, isFalse, isPresent, isPresent, isRepeatableAnnotation, isRepeatableAnnotation, isTrue, isTrue, longValue, longValue, stringValue, stringValue, stringValue, stringValue, stringValues, stringValues, stringValues, stringValues, synthesize, synthesize, synthesizeAll, synthesizeAnnotationsByType, synthesizeDeclared, synthesizeDeclared, synthesizeDeclared, synthesizeDeclaredAnnotationsByType
    • Constructor Detail

      • AbstractProviderDefinition

        public AbstractProviderDefinition()
    • Method Detail

      • isContainerType

        public boolean isContainerType()
        Description copied from interface: BeanType
        Checks whether the bean type is a container type.
        Specified by:
        isContainerType in interface BeanType<T>
        Returns:
        Whether the type is a container type like Iterable.
      • isPresent

        public boolean isPresent()
        Specified by:
        isPresent in interface BeanDefinitionReference<T>
        Returns:
        Is the underlying bean type present on the classpath
      • buildProvider

        @NonNull
        protected abstract T buildProvider​(@NonNull
                                           BeanResolutionContext resolutionContext,
                                           @NonNull
                                           BeanContext context,
                                           @NonNull
                                           io.micronaut.core.type.Argument<java.lang.Object> argument,
                                           @Nullable
                                           Qualifier<java.lang.Object> qualifier,
                                           boolean singleton)
        Builds a provider implementation.
        Parameters:
        resolutionContext - The resolution context
        context - The context
        argument - The argument
        qualifier - The qualifier
        singleton - Whether the bean is a singleton
        Returns:
        The provider
      • isAllowEmptyProviders

        protected boolean isAllowEmptyProviders​(BeanContext context)
        Return whether missing providers are allowed for this implementation. If false a NoSuchBeanException is thrown.
        Parameters:
        context - The context
        Returns:
        Returns true if missing providers are allowed
      • isAbstract

        public final boolean isAbstract()
        Specified by:
        isAbstract in interface BeanDefinition<T>
        Returns:
        Whether the bean definition is abstract
      • getTypeArguments

        @NonNull
        public final java.util.List<io.micronaut.core.type.Argument<?>> getTypeArguments​(java.lang.Class<?> type)
        Description copied from interface: BeanDefinition
        Return the type arguments for the given interface or super type for this bean.
        Specified by:
        getTypeArguments in interface BeanDefinition<T>
        Parameters:
        type - The super class or interface type
        Returns:
        The type arguments
      • getTypeArguments

        @NonNull
        public final java.util.List<io.micronaut.core.type.Argument<?>> getTypeArguments()
        Description copied from interface: BeanDefinition
        If the bean itself declares any type arguments this method will return the classes that represent those types.
        Specified by:
        getTypeArguments in interface BeanDefinition<T>
        Returns:
        The type arguments
      • getAnnotationMetadata

        public io.micronaut.core.annotation.AnnotationMetadata getAnnotationMetadata()
        Specified by:
        getAnnotationMetadata in interface io.micronaut.core.annotation.AnnotationMetadataProvider
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object