Package io.micronaut.inject
Interface DelegatingBeanDefinition<T>
- Type Parameters:
T
- The bean definition type
- All Superinterfaces:
AnnotationMetadata
,AnnotationMetadataDelegate
,AnnotationMetadataProvider
,AnnotationSource
,ArgumentCoercible<T>
,BeanContextConditional
,BeanDefinition<T>
,BeanInfo<T>
,BeanType<T>
,Named
,QualifiedBeanType<T>
An interface for wrapping a
BeanDefinition
with another that delegates and potentially decorates the
BeanDefinition
instance.- Since:
- 1.0
- Author:
- Graeme Rocher
-
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
-
Method Summary
Modifier and TypeMethodDescriptiondefault <R> Optional<ExecutableMethod<T,
R>> findMethod
(String name, Class<?>... argumentTypes) Finds a singleExecutableMethod
for the given name and argument types.default <R> Stream<ExecutableMethod<T,
R>> findPossibleMethods
(String name) Finds possible methods for the given method name.default AnnotationMetadata
Supplies the metadata.Returns the bean type.default ConstructorInjectionPoint<T>
The single concrete constructor that is an injection point for creating the bean.default Collection<ExecutableMethod<T,
?>> default Collection<FieldInjectionPoint<T,
?>> All the fields that require injection.default Collection<MethodInjectionPoint<T,
?>> All methods that require injection.getName()
default Collection<MethodInjectionPoint<T,
?>> All the methods that should be called once the bean has been fully initialized and constructed.default Collection<MethodInjectionPoint<T,
?>> All the methods that should be called when the object is to be destroyed.default Collection<Class<?>>
default <R> ExecutableMethod<T,
R> getRequiredMethod
(String name, Class<?>... argumentTypes) Finds a singleExecutableMethod
for the given name and argument types.default Optional<Class<? extends Annotation>>
getScope()
getTypeArguments
(String type) Return the type arguments for the given interface or super type for this bean.default boolean
default boolean
isEnabled
(@NonNull BeanContext context, @Nullable BeanResolutionContext resolutionContext) Return whether this component is enabled for the given context.default boolean
isEnabled
(BeanContext context) Return whether this component is enabled for the given context.default boolean
default boolean
default boolean
default boolean
By default, when theBeanContext
is started, theBeanDefinition.getExecutableMethods()
are not processed by registeredExecutableMethodProcessor
instances unless this method returns true.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.BeanDefinition
asArgument, getContainerElement, getDeclaredQualifier, getGenericBeanType, getTypeArguments, getTypeArguments, getTypeParameters, getTypeParameters, hasAnnotatedMethod, isCandidateBean, isConfigurationProperties, isProxy, resolveDynamicQualifier
Methods inherited from interface io.micronaut.inject.BeanType
getBeanName, getExposedTypes, isContainerType
-
Method Details
-
getTarget
BeanDefinition<T> getTarget()- Returns:
- The target definition
-
requiresMethodProcessing
default 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:
-
getScope
- Specified by:
getScope
in interfaceBeanDefinition<T>
- Returns:
- The scope of the bean
-
getScopeName
- Specified by:
getScopeName
in interfaceBeanDefinition<T>
- Returns:
- The name of the scope
-
getAnnotationMetadata
Description copied from interface:AnnotationMetadataProvider
Supplies the metadata. Defaults toAnnotationMetadata.EMPTY_METADATA
.- Specified by:
getAnnotationMetadata
in interfaceAnnotationMetadataProvider
- Returns:
- The
AnnotationMetadata
-
getRequiredMethod
Description copied from interface:BeanDefinition
Finds a singleExecutableMethod
for the given name and argument types.- Specified by:
getRequiredMethod
in interfaceBeanDefinition<T>
- Type Parameters:
R
- The return type- Parameters:
name
- The method nameargumentTypes
- The argument types- Returns:
- An optional
ExecutableMethod
-
isAbstract
default boolean isAbstract()- Specified by:
isAbstract
in interfaceBeanDefinition<T>
- Returns:
- Whether the bean definition is abstract
-
isSingleton
default boolean isSingleton()- Specified by:
isSingleton
in interfaceBeanDefinition<T>
- Returns:
- Whether the scope is singleton
-
isIterable
default boolean isIterable()- Specified by:
isIterable
in interfaceBeanDefinition<T>
- Returns:
- Whether the bean declared with
EachProperty
orEachBean
-
getBeanType
Description copied from interface:BeanType
Returns the bean type.- Specified by:
getBeanType
in interfaceBeanDefinition<T>
- Specified by:
getBeanType
in interfaceBeanInfo<T>
- Specified by:
getBeanType
in interfaceBeanType<T>
- Returns:
- The produced bean type
-
getConstructor
Description copied from interface:BeanDefinition
The single concrete constructor that is an injection point for creating the bean.- Specified by:
getConstructor
in interfaceBeanDefinition<T>
- Returns:
- The constructor injection point
-
getRequiredComponents
- Specified by:
getRequiredComponents
in interfaceBeanDefinition<T>
- Returns:
- All required components for this entity definition
-
getInjectedMethods
Description copied from interface:BeanDefinition
All methods that require injection. This is a subset of all the methods in the class.- Specified by:
getInjectedMethods
in interfaceBeanDefinition<T>
- Returns:
- The required properties
-
getInjectedFields
Description copied from interface:BeanDefinition
All the fields that require injection.- Specified by:
getInjectedFields
in interfaceBeanDefinition<T>
- Returns:
- The required fields
-
getPostConstructMethods
Description copied from interface:BeanDefinition
All the methods that should be called once the bean has been fully initialized and constructed.- Specified by:
getPostConstructMethods
in interfaceBeanDefinition<T>
- Returns:
- Methods to call post construct
-
getPreDestroyMethods
Description copied from interface:BeanDefinition
All the methods that should be called when the object is to be destroyed.- Specified by:
getPreDestroyMethods
in interfaceBeanDefinition<T>
- Returns:
- Methods to call pre-destroy
-
getName
-
findMethod
Description copied from interface:BeanDefinition
Finds a singleExecutableMethod
for the given name and argument types.- Specified by:
findMethod
in interfaceBeanDefinition<T>
- Type Parameters:
R
- The return type- Parameters:
name
- The method nameargumentTypes
- The argument types- Returns:
- An optional
ExecutableMethod
-
findPossibleMethods
Description copied from interface:BeanDefinition
Finds possible methods for the given method name.- Specified by:
findPossibleMethods
in interfaceBeanDefinition<T>
- Type Parameters:
R
- The return type- Parameters:
name
- The method name- Returns:
- The possible methods
-
getExecutableMethods
- Specified by:
getExecutableMethods
in interfaceBeanDefinition<T>
- Returns:
- The
ExecutableMethod
instances for this definition
-
isPrimary
default boolean isPrimary() -
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
default boolean isEnabled(@NonNull @NonNull BeanContext context, @Nullable @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
-
getDeclaringType
- Specified by:
getDeclaringType
in interfaceBeanDefinition<T>
- Returns:
- The type that declares this definition, null if not applicable.
-
getTypeArguments
Description copied from interface:BeanDefinition
Return the type arguments for the given interface or super type for this bean.- Specified by:
getTypeArguments
in interfaceBeanDefinition<T>
- Parameters:
type
- The super class or interface type- Returns:
- The type arguments
-