Package io.micronaut.context
Class AbstractInitializableBeanDefinitionReference<T>
- java.lang.Object
-
- io.micronaut.context.AbstractInitializableBeanDefinitionReference<T>
-
- Type Parameters:
T
- The bean type
- All Implemented Interfaces:
io.micronaut.core.annotation.AnnotationMetadataProvider
,io.micronaut.core.annotation.AnnotationSource
,BeanContextConditional
,BeanDefinitionReference<T>
,BeanType<T>
@Internal public abstract class AbstractInitializableBeanDefinitionReference<T> extends java.lang.Object implements BeanDefinitionReference<T>
An uninitialized and unloaded component definition with basic information available regarding its requirements.- Since:
- 3.0
-
-
Constructor Summary
Constructors Constructor Description AbstractInitializableBeanDefinitionReference(java.lang.String beanTypeName, java.lang.String beanDefinitionTypeName, io.micronaut.core.annotation.AnnotationMetadata annotationMetadata, boolean isPrimary, boolean isContextScope, boolean isConditional, boolean isContainerType, boolean isSingleton, boolean isConfigurationProperties, boolean hasExposedTypes, boolean requiresMethodProcessing)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object o)
io.micronaut.core.annotation.AnnotationMetadata
getAnnotationMetadata()
java.lang.String
getBeanDefinitionName()
protected abstract java.lang.Class<? extends BeanDefinition<?>>
getBeanDefinitionType()
Implementors should provide an implementation of this method that returns the bean definition type.java.util.Set<java.lang.Class<?>>
getExposedTypes()
Returns a potentially limited subset of bean types exposed by this bean.java.lang.String
getName()
int
hashCode()
boolean
isConfigurationProperties()
boolean
isContainerType()
Checks whether the bean type is a container type.boolean
isContextScope()
boolean
isEnabled(BeanContext context)
Return whether this component is enabled for the given context.boolean
isEnabled(BeanContext context, BeanResolutionContext resolutionContext)
Return whether this component is enabled for the given context.boolean
isPresent()
boolean
isPrimary()
boolean
isSingleton()
BeanDefinition
load(BeanContext context)
Loads the bean definition for the currentBeanContext
.boolean
requiresMethodProcessing()
By default, when theBeanContext
is started, theBeanDefinition.getExecutableMethods()
are not processed by registeredExecutableMethodProcessor
instances unless this method returns true.java.lang.String
toString()
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface io.micronaut.core.annotation.AnnotationMetadataProvider
findAnnotation, findAnnotation, findDeclaredAnnotation, findDeclaredAnnotation, 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.BeanDefinitionReference
load
-
Methods inherited from interface io.micronaut.inject.BeanType
getBeanType, isCandidateBean
-
-
-
-
Constructor Detail
-
AbstractInitializableBeanDefinitionReference
public AbstractInitializableBeanDefinitionReference(java.lang.String beanTypeName, java.lang.String beanDefinitionTypeName, io.micronaut.core.annotation.AnnotationMetadata annotationMetadata, boolean isPrimary, boolean isContextScope, boolean isConditional, boolean isContainerType, boolean isSingleton, boolean isConfigurationProperties, boolean hasExposedTypes, boolean requiresMethodProcessing)
- Parameters:
beanTypeName
- The bean type namebeanDefinitionTypeName
- The bean definition type nameannotationMetadata
- The annotationMetadataisPrimary
- Is primary bean?isContextScope
- Is context scope?isConditional
- Is conditional? = No @RequiresisContainerType
- Is container type?isSingleton
- Is singleton?isConfigurationProperties
- Is configuration properties?hasExposedTypes
- Has exposed types?requiresMethodProcessing
- Is requires method processing?
-
-
Method Detail
-
getName
public java.lang.String getName()
-
getBeanDefinitionName
public java.lang.String getBeanDefinitionName()
- Specified by:
getBeanDefinitionName
in interfaceBeanDefinitionReference<T>
- Returns:
- The class name of the backing
BeanDefinition
-
getAnnotationMetadata
public io.micronaut.core.annotation.AnnotationMetadata getAnnotationMetadata()
- Specified by:
getAnnotationMetadata
in interfaceio.micronaut.core.annotation.AnnotationMetadataProvider
-
isPrimary
public boolean isPrimary()
-
isSingleton
public boolean isSingleton()
- Specified by:
isSingleton
in interfaceBeanDefinitionReference<T>
- Returns:
- Is this bean a singleton.
-
isConfigurationProperties
public boolean isConfigurationProperties()
- Specified by:
isConfigurationProperties
in interfaceBeanDefinitionReference<T>
- Returns:
- Is this bean a configuration properties.
-
isContainerType
public boolean isContainerType()
Description copied from interface:BeanType
Checks whether the bean type is a container type.- Specified by:
isContainerType
in interfaceBeanType<T>
- Returns:
- Whether the type is a container type like
Iterable
.
-
isContextScope
public boolean isContextScope()
- Specified by:
isContextScope
in interfaceBeanDefinitionReference<T>
- Returns:
- Is this class context scope
-
requiresMethodProcessing
public boolean requiresMethodProcessing()
Description copied from interface:BeanType
By default, when theBeanContext
is started, theBeanDefinition.getExecutableMethods()
are not processed by registeredExecutableMethodProcessor
instances unless this method returns true.- Specified by:
requiresMethodProcessing
in interfaceBeanType<T>
- Returns:
- Whether the bean definition requires method processing
- See Also:
Executable.processOnStartup()
-
getExposedTypes
@NonNull public final java.util.Set<java.lang.Class<?>> getExposedTypes()
Description copied from interface:BeanType
Returns a potentially limited subset of bean types exposed by this bean. The types to be exposed can be defined by theType
annotation.- Specified by:
getExposedTypes
in interfaceBeanType<T>
- Returns:
- The exposed types
-
load
public BeanDefinition load(BeanContext context)
Description copied from interface:BeanDefinitionReference
Loads the bean definition for the currentBeanContext
.- Specified by:
load
in interfaceBeanDefinitionReference<T>
- Parameters:
context
- The bean context- Returns:
- The loaded bean definition or null if it shouldn't be loaded
-
isPresent
public boolean isPresent()
- Specified by:
isPresent
in interfaceBeanDefinitionReference<T>
- Returns:
- Is the underlying bean type present on the classpath
-
isEnabled
public boolean isEnabled(BeanContext context)
Description copied from interface:BeanContextConditional
Return whether this component is enabled for the given context.- Specified by:
isEnabled
in interfaceBeanContextConditional
- Parameters:
context
- The context- Returns:
- True if it is
-
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
- Parameters:
context
- The contextresolutionContext
- The bean resolution context- Returns:
- True if it is
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
getBeanDefinitionType
protected abstract java.lang.Class<? extends BeanDefinition<?>> getBeanDefinitionType()
Implementors should provide an implementation of this method that returns the bean definition type.- Returns:
- The bean definition type.
-
-