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,Ordered,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_MEMBERFields inherited from interface io.micronaut.core.annotation.AnnotationSource
EMPTYFields inherited from interface io.micronaut.core.order.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE -
Method Summary
Modifier and TypeMethodDescriptiondefault <R> Optional<ExecutableMethod<T,R>> findMethod(String name, Class<?>... argumentTypes) Finds a singleExecutableMethodfor the given name and argument types.default <R> Stream<ExecutableMethod<T,R>> findPossibleMethods(String name) Finds possible methods for the given method name.default AnnotationMetadataSupplies 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 singleExecutableMethodfor 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 booleandefault booleanisEnabled(@NonNull BeanContext context, @Nullable BeanResolutionContext resolutionContext) Return whether this component is enabled for the given context.default booleanisEnabled(BeanContext context) Return whether this component is enabled for the given context.default booleandefault booleandefault booleandefault booleanBy default, when theBeanContextis started, theBeanDefinition.getExecutableMethods()are not processed by registeredExecutableMethodProcessorinstances unless this method returns true.Methods inherited from interface io.micronaut.core.annotation.AnnotationMetadata
enumValuesSet, enumValuesSet, getValues, hasDeclaredStereotype, hasEvaluatedExpressions, hasStereotypeNonRepeating, isAnnotationPresent, isDeclaredAnnotationPresentMethods 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, synthesizeDeclaredAnnotationsByTypeMethods inherited from interface io.micronaut.inject.BeanDefinition
asArgument, getBeanDescription, getBeanDescription, getContainerElement, getDeclaredQualifier, getGenericBeanType, getTypeArguments, getTypeArguments, getTypeInformation, getTypeParameters, getTypeParameters, hasAnnotatedMethod, isCandidateBean, isConfigurationProperties, isProxy, resolveDynamicQualifierMethods 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: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:
-
getScope
- Specified by:
getScopein interfaceBeanDefinition<T>- Returns:
- The scope of the bean
-
getScopeName
- Specified by:
getScopeNamein interfaceBeanDefinition<T>- Returns:
- The name of the scope
-
getAnnotationMetadata
Description copied from interface:AnnotationMetadataProviderSupplies the metadata. Defaults toAnnotationMetadata.EMPTY_METADATA.- Specified by:
getAnnotationMetadatain interfaceAnnotationMetadataProvider- Returns:
- The
AnnotationMetadata
-
getRequiredMethod
Description copied from interface:BeanDefinitionFinds a singleExecutableMethodfor the given name and argument types.- Specified by:
getRequiredMethodin 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:
isAbstractin interfaceBeanDefinition<T>- Returns:
- Whether the bean definition is abstract
-
isSingleton
default boolean isSingleton()- Specified by:
isSingletonin interfaceBeanDefinition<T>- Returns:
- Whether the scope is singleton
-
isIterable
default boolean isIterable()- Specified by:
isIterablein interfaceBeanDefinition<T>- Returns:
- Whether the bean declared with
EachPropertyorEachBean
-
getBeanType
Description copied from interface:BeanTypeReturns the bean type.- Specified by:
getBeanTypein interfaceBeanDefinition<T>- Specified by:
getBeanTypein interfaceBeanInfo<T>- Specified by:
getBeanTypein interfaceBeanType<T>- Returns:
- The produced bean type
-
getConstructor
Description copied from interface:BeanDefinitionThe single concrete constructor that is an injection point for creating the bean.- Specified by:
getConstructorin interfaceBeanDefinition<T>- Returns:
- The constructor injection point
-
getRequiredComponents
- Specified by:
getRequiredComponentsin interfaceBeanDefinition<T>- Returns:
- All required components for this entity definition
-
getInjectedMethods
Description copied from interface:BeanDefinitionAll methods that require injection. This is a subset of all the methods in the class.- Specified by:
getInjectedMethodsin interfaceBeanDefinition<T>- Returns:
- The required properties
-
getInjectedFields
Description copied from interface:BeanDefinitionAll the fields that require injection.- Specified by:
getInjectedFieldsin interfaceBeanDefinition<T>- Returns:
- The required fields
-
getPostConstructMethods
Description copied from interface:BeanDefinitionAll the methods that should be called once the bean has been fully initialized and constructed.- Specified by:
getPostConstructMethodsin interfaceBeanDefinition<T>- Returns:
- Methods to call post construct
-
getPreDestroyMethods
Description copied from interface:BeanDefinitionAll the methods that should be called when the object is to be destroyed.- Specified by:
getPreDestroyMethodsin interfaceBeanDefinition<T>- Returns:
- Methods to call pre-destroy
-
getName
-
findMethod
Description copied from interface:BeanDefinitionFinds a singleExecutableMethodfor the given name and argument types.- Specified by:
findMethodin 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:BeanDefinitionFinds possible methods for the given method name.- Specified by:
findPossibleMethodsin interfaceBeanDefinition<T>- Type Parameters:
R- The return type- Parameters:
name- The method name- Returns:
- The possible methods
-
getExecutableMethods
- Specified by:
getExecutableMethodsin interfaceBeanDefinition<T>- Returns:
- The
ExecutableMethodinstances for this definition
-
isPrimary
default boolean isPrimary() -
isEnabled
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
default boolean isEnabled(@NonNull @NonNull BeanContext context, @Nullable @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
-
getDeclaringType
- Specified by:
getDeclaringTypein interfaceBeanDefinition<T>- Returns:
- The type that declares this definition, null if not applicable.
-
getTypeArguments
Description copied from interface:BeanDefinitionReturn the type arguments for the given interface or super type for this bean.- Specified by:
getTypeArgumentsin interfaceBeanDefinition<T>- Parameters:
type- The super class or interface type- Returns:
- The type arguments
-