Package io.micronaut.context
Class AbstractBeanDefinitionReference
- java.lang.Object
-
- io.micronaut.context.AbstractBeanDefinitionReference
-
- All Implemented Interfaces:
io.micronaut.core.annotation.AnnotationMetadataProvider
,io.micronaut.core.annotation.AnnotationSource
,BeanContextConditional
,BeanDefinitionReference
,BeanType
@Internal public abstract class AbstractBeanDefinitionReference extends java.lang.Object implements BeanDefinitionReference
An uninitialized and unloaded component definition with basic information available regarding its requirements.- Since:
- 1.0
-
-
Constructor Summary
Constructors Constructor Description AbstractBeanDefinitionReference(java.lang.String beanTypeName, java.lang.String beanDefinitionTypeName)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object o)
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
isContextScope()
boolean
isEnabled(BeanContext beanContext)
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()
BeanDefinition
load(BeanContext context)
Loads the bean definition for the currentBeanContext
.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, 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
-
Methods inherited from interface io.micronaut.inject.BeanDefinitionReference
isConfigurationProperties, isSingleton, load
-
Methods inherited from interface io.micronaut.inject.BeanType
getBeanType, isCandidateBean, isContainerType, requiresMethodProcessing
-
-
-
-
Method Detail
-
isPrimary
public boolean isPrimary()
-
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
- Returns:
- The exposed types
-
getName
public java.lang.String getName()
-
load
public BeanDefinition load(BeanContext context)
Description copied from interface:BeanDefinitionReference
Loads the bean definition for the currentBeanContext
.- Specified by:
load
in interfaceBeanDefinitionReference
- Parameters:
context
- The bean context- Returns:
- The loaded bean definition or null if it shouldn't be loaded
-
isContextScope
public boolean isContextScope()
- Specified by:
isContextScope
in interfaceBeanDefinitionReference
- Returns:
- Is this class context scope
-
getBeanDefinitionName
public java.lang.String getBeanDefinitionName()
- Specified by:
getBeanDefinitionName
in interfaceBeanDefinitionReference
- Returns:
- The class name of the backing
BeanDefinition
-
isPresent
public boolean isPresent()
- Specified by:
isPresent
in interfaceBeanDefinitionReference
- Returns:
- Is the underlying bean type present on the classpath
-
isEnabled
public boolean isEnabled(BeanContext beanContext)
Description copied from interface:BeanContextConditional
Return whether this component is enabled for the given context.- Specified by:
isEnabled
in interfaceBeanContextConditional
- Parameters:
beanContext
- The 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.
-
isEnabled
public boolean isEnabled(@NonNull BeanContext context, @Nullable 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
-
-