Package io.micronaut.inject
Interface BeanType<T>
-
- Type Parameters:
T
- The bean type
- All Superinterfaces:
io.micronaut.core.annotation.AnnotationMetadataProvider
,io.micronaut.core.annotation.AnnotationSource
,BeanContextConditional
- All Known Subinterfaces:
AdvisedBeanType<T>
,BeanDefinition<T>
,BeanDefinitionReference<T>
,DelegatingBeanDefinition<T>
,DisposableBeanDefinition<T>
,InitializingBeanDefinition<T>
,ProxyBeanDefinition<T>
,RuntimeBeanDefinition<T>
,ValidatedBeanDefinition<T>
- All Known Implementing Classes:
AbstractBeanDefinition
,AbstractBeanDefinitionReference
,AbstractInitializableBeanDefinition
,AbstractInitializableBeanDefinitionReference
,AbstractParametrizedBeanDefinition
,AbstractProviderDefinition
,ApplicationEventPublisherFactory
,ArgumentBeanType
,BeanProviderDefinition
,BeanRegistration
,JakartaProviderBeanDefinition
,JavaxProviderBeanDefinition
public interface BeanType<T> extends io.micronaut.core.annotation.AnnotationMetadataProvider, BeanContextConditional
A reference to a bean. Implemented by botherBeanDefinitionReference
andBeanDefinition
.- Since:
- 1.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description java.lang.Class<T>
getBeanType()
Returns the bean type.default java.util.Set<java.lang.Class<?>>
getExposedTypes()
Returns a potentially limited subset of bean types exposed by this bean.default java.lang.String
getName()
default boolean
isCandidateBean(io.micronaut.core.type.Argument<?> beanType)
Return whether this bean type is a candidate for dependency injection for the passed type.default boolean
isContainerType()
Checks whether the bean type is a container type.default boolean
isPrimary()
default boolean
requiresMethodProcessing()
By default, when theBeanContext
is started, theBeanDefinition.getExecutableMethods()
are not processed by registeredExecutableMethodProcessor
instances unless this method returns true.-
Methods inherited from interface io.micronaut.core.annotation.AnnotationMetadataProvider
findAnnotation, findAnnotation, findDeclaredAnnotation, findDeclaredAnnotation, getAnnotationMetadata, isAnnotationPresent, isDeclaredAnnotationPresent, synthesize, synthesizeAll, synthesizeAnnotationsByType, synthesizeDeclared, synthesizeDeclared, synthesizeDeclaredAnnotationsByType
-
Methods inherited from interface io.micronaut.core.annotation.AnnotationSource
getAnnotation, getAnnotation, getDeclaredAnnotation, getDeclaredAnnotation, isAnnotationPresent, isDeclaredAnnotationPresent, synthesize, synthesizeDeclared
-
Methods inherited from interface io.micronaut.inject.BeanContextConditional
isEnabled, isEnabled
-
-
-
-
Method Detail
-
isPrimary
default boolean isPrimary()
- Returns:
- Whether the bean definition is the
Primary
-
getBeanType
java.lang.Class<T> getBeanType()
Returns the bean type.- Returns:
- The underlying bean type
-
isContainerType
default boolean isContainerType()
Checks whether the bean type is a container type.- Returns:
- Whether the type is a container type like
Iterable
. - Since:
- 3.0.0
-
getExposedTypes
@NonNull default java.util.Set<java.lang.Class<?>> getExposedTypes()
Returns a potentially limited subset of bean types exposed by this bean. The types to be exposed can be defined by theType
annotation.- Returns:
- The exposed types
- Since:
- 3.0.0
-
isCandidateBean
default boolean isCandidateBean(@Nullable io.micronaut.core.type.Argument<?> beanType)
Return whether this bean type is a candidate for dependency injection for the passed type.- Parameters:
beanType
- The bean type- Returns:
- True if it is
- Since:
- 3.0.0
-
getName
default java.lang.String getName()
- Returns:
- The class name
-
requiresMethodProcessing
default boolean requiresMethodProcessing()
By default, when theBeanContext
is started, theBeanDefinition.getExecutableMethods()
are not processed by registeredExecutableMethodProcessor
instances unless this method returns true.- Returns:
- Whether the bean definition requires method processing
- See Also:
Executable.processOnStartup()
-
-