Package io.micronaut.inject.provider
Class JakartaProviderBeanDefinition
- java.lang.Object
-
- io.micronaut.inject.provider.AbstractProviderDefinition<jakarta.inject.Provider<java.lang.Object>>
-
- io.micronaut.inject.provider.JakartaProviderBeanDefinition
-
- All Implemented Interfaces:
io.micronaut.core.annotation.AnnotationMetadata
,io.micronaut.core.annotation.AnnotationMetadataDelegate
,io.micronaut.core.annotation.AnnotationMetadataProvider
,io.micronaut.core.annotation.AnnotationSource
,io.micronaut.core.naming.Named
,io.micronaut.core.type.ArgumentCoercible<jakarta.inject.Provider<java.lang.Object>>
,BeanContextConditional
,BeanDefinition<jakarta.inject.Provider<java.lang.Object>>
,BeanDefinitionReference<jakarta.inject.Provider<java.lang.Object>>
,BeanFactory<jakarta.inject.Provider<java.lang.Object>>
,BeanType<jakarta.inject.Provider<java.lang.Object>>
@Internal public final class JakartaProviderBeanDefinition extends AbstractProviderDefinition<jakarta.inject.Provider<java.lang.Object>>
Implementation for Jakarta bean lookups.- Since:
- 3.0.0
-
-
Field Summary
-
Fields inherited from interface io.micronaut.core.annotation.AnnotationMetadata
CLASS_NAME_SUFFIX, EMPTY_METADATA, VALUE_MEMBER
-
Fields inherited from interface io.micronaut.inject.BeanDefinition
NAMED_ATTRIBUTE
-
-
Constructor Summary
Constructors Constructor Description JakartaProviderBeanDefinition()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected jakarta.inject.Provider<java.lang.Object>
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.java.lang.Class<jakarta.inject.Provider<java.lang.Object>>
getBeanType()
Returns the bean type.boolean
isEnabled(BeanContext context, BeanResolutionContext resolutionContext)
Return whether this component is enabled for the given context.boolean
isPresent()
-
Methods inherited from class io.micronaut.inject.provider.AbstractProviderDefinition
build, equals, getAnnotationMetadata, getBeanDefinitionName, getDeclaredQualifier, getTypeArguments, getTypeArguments, hashCode, isAbstract, isAllowEmptyProviders, isContainerType, isSingleton, load
-
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
-
Methods inherited from interface io.micronaut.inject.BeanContextConditional
isEnabled
-
Methods inherited from interface io.micronaut.inject.BeanDefinition
asArgument, findMethod, findPossibleMethods, getConstructor, getContainerElement, getDeclaringType, getExecutableMethods, getInjectedFields, getInjectedMethods, getName, getPostConstructMethods, getPreDestroyMethods, getRequiredComponents, getRequiredMethod, getScope, getScopeName, getTypeArguments, getTypeParameters, getTypeParameters, inject, inject, isCandidateBean, isIterable, isProvided, isProxy, resolveDynamicQualifier
-
Methods inherited from interface io.micronaut.inject.BeanDefinitionReference
isConfigurationProperties, isContextScope, load
-
Methods inherited from interface io.micronaut.inject.BeanFactory
build
-
Methods inherited from interface io.micronaut.inject.BeanType
getExposedTypes, getName, isPrimary, requiresMethodProcessing
-
-
-
-
Method Detail
-
isEnabled
public boolean isEnabled(BeanContext context, BeanResolutionContext resolutionContext)
Description copied from interface:BeanContextConditional
Return whether this component is enabled for the given context.- Specified by:
isEnabled
in interfaceBeanContextConditional
- Overrides:
isEnabled
in classAbstractProviderDefinition<jakarta.inject.Provider<java.lang.Object>>
- Parameters:
context
- The contextresolutionContext
- The bean resolution context- Returns:
- True if it is
-
getBeanType
public java.lang.Class<jakarta.inject.Provider<java.lang.Object>> getBeanType()
Description copied from interface:BeanType
Returns the bean type.- Returns:
- The produced bean type
-
isPresent
public boolean isPresent()
- Specified by:
isPresent
in interfaceBeanDefinitionReference<jakarta.inject.Provider<java.lang.Object>>
- Overrides:
isPresent
in classAbstractProviderDefinition<jakarta.inject.Provider<java.lang.Object>>
- Returns:
- Is the underlying bean type present on the classpath
-
buildProvider
protected jakarta.inject.Provider<java.lang.Object> buildProvider(BeanResolutionContext resolutionContext, BeanContext context, io.micronaut.core.type.Argument<java.lang.Object> argument, Qualifier<java.lang.Object> qualifier, boolean singleton)
Description copied from class:AbstractProviderDefinition
Builds a provider implementation.- Specified by:
buildProvider
in classAbstractProviderDefinition<jakarta.inject.Provider<java.lang.Object>>
- Parameters:
resolutionContext
- The resolution contextcontext
- The contextargument
- The argumentqualifier
- The qualifiersingleton
- Whether the bean is a singleton- Returns:
- The provider
-
-