Package io.micronaut.context
Class AbstractInitializableBeanDefinitionReference<T>
java.lang.Object
io.micronaut.context.AbstractInitializableBeanDefinitionReference<T>
- Type Parameters:
T
- The bean type
- All Implemented Interfaces:
AnnotationMetadata
,AnnotationMetadataDelegate
,AnnotationMetadataProvider
,AnnotationSource
,BeanInfo<T>
,Ordered
,ArgumentCoercible<T>
,BeanContextConditional
,BeanDefinitionReference<T>
,BeanType<T>
,QualifiedBeanType<T>
@Internal
public abstract class AbstractInitializableBeanDefinitionReference<T>
extends Object
implements BeanDefinitionReference<T>
An uninitialized and unloaded component definition with basic information available regarding its requirements.
- Since:
- 3.0
- Author:
- Denis Stepanov
-
Field Summary
Fields inherited from interface io.micronaut.core.annotation.AnnotationMetadata
CLASS_NAME_SUFFIX, EMPTY_METADATA, VALUE_MEMBER
Fields inherited from interface io.micronaut.core.annotation.AnnotationSource
EMPTY
Fields inherited from interface io.micronaut.core.order.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
-
Constructor Summary
ModifierConstructorDescriptionAbstractInitializableBeanDefinitionReference
(String beanTypeName, String beanDefinitionTypeName, AnnotationMetadata annotationMetadata, boolean isPrimary, boolean isContextScope, boolean isConditional, boolean isContainerType, boolean isSingleton, boolean isConfigurationProperties, boolean hasExposedTypes, boolean requiresMethodProcessing) protected
AbstractInitializableBeanDefinitionReference
(String beanTypeName, String beanDefinitionTypeName, AnnotationMetadata annotationMetadata, boolean isPrimary, boolean isContextScope, boolean isConditional, boolean isContainerType, boolean isSingleton, boolean isConfigurationProperties, boolean hasExposedTypes, boolean requiresMethodProcessing, boolean isProxiedBean, boolean isProxyTarget) -
Method Summary
Modifier and TypeMethodDescriptionboolean
Supplies the metadata.protected abstract Class<? extends BeanDefinition<?>>
Implementors should provide an implementation of this method that returns the bean definition type.Returns a potentially limited subset of bean types exposed by this bean.getName()
int
hashCode()
boolean
boolean
Checks whether the bean type is a container type.boolean
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
boolean
boolean
Returns whether another bean exists that proxies this bean.boolean
boolean
load
(BeanContext context) Loads the bean definition for the currentBeanContext
.boolean
By default, when theBeanContext
is started, theBeanDefinition.getExecutableMethods()
are not processed by registeredExecutableMethodProcessor
instances unless this method returns true.toString()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface io.micronaut.core.annotation.AnnotationMetadata
enumValuesSet, enumValuesSet, getValues, hasDeclaredStereotype, hasEvaluatedExpressions, hasStereotypeNonRepeating, isAnnotationPresent, isDeclaredAnnotationPresent
Methods inherited from interface io.micronaut.core.annotation.AnnotationMetadataDelegate
booleanValue, booleanValue, booleanValue, booleanValue, classValue, classValue, classValue, classValue, classValues, classValues, classValues, classValues, copyAnnotationMetadata, doubleValue, doubleValue, doubleValue, enumValue, enumValue, enumValue, enumValue, enumValues, enumValues, enumValues, enumValues, findAnnotation, findAnnotation, findDeclaredAnnotation, findDeclaredAnnotation, findRepeatableAnnotation, findRepeatableAnnotation, getAnnotation, getAnnotation, getAnnotationNameByStereotype, getAnnotationNameByStereotype, getAnnotationNames, getAnnotationNamesByStereotype, getAnnotationNamesByStereotype, getAnnotationType, getAnnotationType, getAnnotationTypeByStereotype, getAnnotationTypeByStereotype, getAnnotationTypesByStereotype, getAnnotationTypesByStereotype, getAnnotationTypesByStereotype, getAnnotationValuesByName, getAnnotationValuesByStereotype, getAnnotationValuesByType, getDeclaredAnnotation, getDeclaredAnnotation, getDeclaredAnnotationNameByStereotype, getDeclaredAnnotationNames, getDeclaredAnnotationNamesByStereotype, getDeclaredAnnotationTypeByStereotype, getDeclaredAnnotationTypeByStereotype, getDeclaredAnnotationValuesByName, getDeclaredAnnotationValuesByType, getDeclaredMetadata, getDeclaredStereotypeAnnotationNames, getDefaultValue, getDefaultValue, getDefaultValue, getDefaultValue, getDefaultValues, getStereotypeAnnotationNames, getTargetAnnotationMetadata, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValues, getValues, hasAnnotation, hasAnnotation, hasDeclaredAnnotation, hasDeclaredAnnotation, hasDeclaredStereotype, hasDeclaredStereotype, hasDeclaredStereotype, hasPropertyExpressions, hasSimpleAnnotation, hasSimpleDeclaredAnnotation, hasStereotype, hasStereotype, hasStereotype, hasStereotype, intValue, intValue, intValue, isAnnotationPresent, isDeclaredAnnotationPresent, isEmpty, isFalse, isFalse, isPresent, isPresent, isRepeatableAnnotation, isRepeatableAnnotation, isTrue, isTrue, longValue, longValue, stringValue, stringValue, stringValue, stringValue, stringValues, stringValues, stringValues, stringValues, synthesize, synthesize, synthesizeAll, synthesizeAnnotationsByType, synthesizeDeclared, synthesizeDeclared, synthesizeDeclared, synthesizeDeclaredAnnotationsByType
Methods inherited from interface io.micronaut.inject.BeanDefinitionReference
load
Methods inherited from interface io.micronaut.core.beans.BeanInfo
asArgument, getGenericBeanType, getOrder
Methods inherited from interface io.micronaut.inject.BeanType
getBeanName, getBeanType, isCandidateBean
Methods inherited from interface io.micronaut.inject.QualifiedBeanType
getDeclaredQualifier, resolveDynamicQualifier
-
Constructor Details
-
AbstractInitializableBeanDefinitionReference
public AbstractInitializableBeanDefinitionReference(String beanTypeName, String beanDefinitionTypeName, 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?
-
AbstractInitializableBeanDefinitionReference
protected AbstractInitializableBeanDefinitionReference(String beanTypeName, String beanDefinitionTypeName, AnnotationMetadata annotationMetadata, boolean isPrimary, boolean isContextScope, boolean isConditional, boolean isContainerType, boolean isSingleton, boolean isConfigurationProperties, boolean hasExposedTypes, boolean requiresMethodProcessing, boolean isProxiedBean, boolean isProxyTarget) - 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?isProxiedBean
- Is the bean proxiedisProxyTarget
- Is the bean a retained proxy target
-
-
Method Details
-
isProxyTarget
public boolean isProxyTarget()- Specified by:
isProxyTarget
in interfaceBeanDefinitionReference<T>
- Returns:
- Whether this reference is a proxy target.
-
isProxiedBean
public boolean isProxiedBean()Description copied from interface:BeanDefinitionReference
Returns whether another bean exists that proxies this bean. In other words this bean is the target of a proxy.- Specified by:
isProxiedBean
in interfaceBeanDefinitionReference<T>
- Returns:
- Is the reference a proxy target.
-
getName
-
getBeanDefinitionName
- Specified by:
getBeanDefinitionName
in interfaceBeanDefinitionReference<T>
- Returns:
- The class name of the backing
BeanDefinition
-
getAnnotationMetadata
Description copied from interface:AnnotationMetadataProvider
Supplies the metadata. Defaults toAnnotationMetadata.EMPTY_METADATA
.- Specified by:
getAnnotationMetadata
in interfaceAnnotationMetadataProvider
- Returns:
- The
AnnotationMetadata
-
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:
-
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
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
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
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
-
toString
-
hashCode
public int hashCode() -
getBeanDefinitionType
Implementors should provide an implementation of this method that returns the bean definition type.- Returns:
- The bean definition type.
-