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 booleanequals(java.lang.Object o)io.micronaut.core.annotation.AnnotationMetadatagetAnnotationMetadata()java.lang.StringgetBeanDefinitionName()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.StringgetName()inthashCode()booleanisConfigurationProperties()booleanisContainerType()Checks whether the bean type is a container type.booleanisContextScope()booleanisEnabled(BeanContext context)Return whether this component is enabled for the given context.booleanisEnabled(BeanContext context, BeanResolutionContext resolutionContext)Return whether this component is enabled for the given context.booleanisPresent()booleanisPrimary()booleanisSingleton()BeanDefinitionload(BeanContext context)Loads the bean definition for the currentBeanContext.booleanrequiresMethodProcessing()By default, when theBeanContextis started, theBeanDefinition.getExecutableMethods()are not processed by registeredExecutableMethodProcessorinstances unless this method returns true.java.lang.StringtoString()-
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:
getBeanDefinitionNamein interfaceBeanDefinitionReference<T>- Returns:
- The class name of the backing
BeanDefinition
-
getAnnotationMetadata
public io.micronaut.core.annotation.AnnotationMetadata getAnnotationMetadata()
- Specified by:
getAnnotationMetadatain interfaceio.micronaut.core.annotation.AnnotationMetadataProvider
-
isPrimary
public boolean isPrimary()
-
isSingleton
public boolean isSingleton()
- Specified by:
isSingletonin interfaceBeanDefinitionReference<T>- Returns:
- Is this bean a singleton.
-
isConfigurationProperties
public boolean isConfigurationProperties()
- Specified by:
isConfigurationPropertiesin interfaceBeanDefinitionReference<T>- Returns:
- Is this bean a configuration properties.
-
isContainerType
public boolean isContainerType()
Description copied from interface:BeanTypeChecks whether the bean type is a container type.- Specified by:
isContainerTypein interfaceBeanType<T>- Returns:
- Whether the type is a container type like
Iterable.
-
isContextScope
public boolean isContextScope()
- Specified by:
isContextScopein interfaceBeanDefinitionReference<T>- Returns:
- Is this class context scope
-
requiresMethodProcessing
public boolean requiresMethodProcessing()
Description copied from interface:BeanTypeBy default, when theBeanContextis started, theBeanDefinition.getExecutableMethods()are not processed by registeredExecutableMethodProcessorinstances unless this method returns true.- Specified by:
requiresMethodProcessingin 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:BeanTypeReturns a potentially limited subset of bean types exposed by this bean. The types to be exposed can be defined by theTypeannotation.- Specified by:
getExposedTypesin interfaceBeanType<T>- Returns:
- The exposed types
-
load
public BeanDefinition load(BeanContext context)
Description copied from interface:BeanDefinitionReferenceLoads the bean definition for the currentBeanContext.- Specified by:
loadin 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:
isPresentin interfaceBeanDefinitionReference<T>- Returns:
- Is the underlying bean type present on the classpath
-
isEnabled
public boolean isEnabled(BeanContext context)
Description copied from interface:BeanContextConditionalReturn whether this component is enabled for the given context.- Specified by:
isEnabledin interfaceBeanContextConditional- Parameters:
context- The context- Returns:
- True if it is
-
isEnabled
public boolean isEnabled(BeanContext context, BeanResolutionContext resolutionContext)
Description copied from interface:BeanContextConditionalReturn whether this component is enabled for the given context.- Specified by:
isEnabledin interfaceBeanContextConditional- Parameters:
context- The contextresolutionContext- The bean resolution context- Returns:
- True if it is
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein 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.
-
-