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 booleanequals(java.lang.Object o)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()booleanisContextScope()booleanisEnabled(BeanContext beanContext)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()BeanDefinitionload(BeanContext context)Loads the bean definition for the currentBeanContext.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, 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: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- Returns:
- The exposed types
-
getName
public java.lang.String getName()
-
load
public BeanDefinition load(BeanContext context)
Description copied from interface:BeanDefinitionReferenceLoads the bean definition for the currentBeanContext.- Specified by:
loadin 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:
isContextScopein interfaceBeanDefinitionReference- Returns:
- Is this class context scope
-
getBeanDefinitionName
public java.lang.String getBeanDefinitionName()
- Specified by:
getBeanDefinitionNamein interfaceBeanDefinitionReference- Returns:
- The class name of the backing
BeanDefinition
-
isPresent
public boolean isPresent()
- Specified by:
isPresentin interfaceBeanDefinitionReference- Returns:
- Is the underlying bean type present on the classpath
-
isEnabled
public boolean isEnabled(BeanContext beanContext)
Description copied from interface:BeanContextConditionalReturn whether this component is enabled for the given context.- Specified by:
isEnabledin interfaceBeanContextConditional- Parameters:
beanContext- The 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.
-
isEnabled
public boolean isEnabled(@NonNull BeanContext context, @Nullable 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
-
-