Interface BeanConstructor<T>
- Type Parameters:
T- The bean type
- All Superinterfaces:
AnnotationMetadataProvider, AnnotationSource, Described
- All Known Implementing Classes:
AbstractBeanConstructor, AbstractBeanDefinitionBeanConstructor, ReflectionBeanConstructor
Models a bean constructor.
- Since:
- 3.0.0
- Author:
- graemerocher
-
Field Summary
Fields inherited from interface AnnotationSource
EMPTY -
Method Summary
Modifier and TypeMethodDescriptionArgument<?>[]Returns the bean type.default StringThe description of the constructor.default StringgetDescription(boolean simple) The description of the constructor.default @Nullable Constructor<T> Returns theConstructorthis bean constructor stands for: the constructor ofgetDeclaringBeanType()whose parameter types are the raw types ofgetArguments().instantiate(@Nullable Object... parameterValues) Instantiate an instance.Methods inherited from interface AnnotationMetadataProvider
findAnnotation, findAnnotation, findDeclaredAnnotation, findDeclaredAnnotation, getAnnotationMetadata, getTargetAnnotationMetadata, isAnnotationPresent, isDeclaredAnnotationPresent, synthesize, synthesizeAll, synthesizeAnnotationsByType, synthesizeDeclared, synthesizeDeclared, synthesizeDeclaredAnnotationsByTypeMethods inherited from interface AnnotationSource
getAnnotation, getAnnotation, getDeclaredAnnotation, getDeclaredAnnotation, isAnnotationPresent, isDeclaredAnnotationPresent, synthesize, synthesizeDeclared
-
Method Details
-
getDeclaringBeanType
-
getArguments
Argument<?>[] getArguments()- Returns:
- The constructor argument types.
-
instantiate
-
getTargetConstructor
Returns theConstructorthis bean constructor stands for: the constructor ofgetDeclaringBeanType()whose parameter types are the raw types ofgetArguments().This is the counterpart of
io.micronaut.inject.MethodReference#getTargetMethod()for constructors. Framework implementations resolve the constructor once and hold it; this default resolves it on every call, so an implementation that knows its constructor should return it directly.The result is
nullwhen the bean is not created through a constructor of the declaring bean type: a bean produced by a factory method or field, or an introspection instantiating through a static creator method, even one whose parameter types a declared constructor shares.- Returns:
- The constructor, or
nullif the declaring bean type declares no such constructor - Since:
- 5.2.2
-
getDescription
The description of the constructor.- Specified by:
getDescriptionin interfaceDescribed- Returns:
- The description
-
getDescription
The description of the constructor.- Specified by:
getDescriptionin interfaceDescribed- Parameters:
simple- Whether to return a simple representation without package names- Returns:
- The description
-