T
- The bean typepublic interface BeanDefinition<T> extends AnnotationMetadataDelegate, Named, BeanType<T>, ArgumentCoercible<T>
Modifier and Type | Field and Description |
---|---|
static String |
NAMED_ATTRIBUTE
Attribute used to store a dynamic bean name.
|
CLASS_NAME_SUFFIX, EMPTY_METADATA, VALUE_MEMBER
EMPTY
Modifier and Type | Method and Description |
---|---|
default Argument<T> |
asArgument() |
default <R> Optional<ExecutableMethod<T,R>> |
findMethod(String name,
Class<?>... argumentTypes)
Finds a single
ExecutableMethod for the given name and argument types. |
default <R> Stream<ExecutableMethod<T,R>> |
findPossibleMethods(String name)
Finds possible methods for the given method name.
|
Class<T> |
getBeanType()
Returns the bean type.
|
default ConstructorInjectionPoint<T> |
getConstructor()
The single concrete constructor that is an injection point for creating the bean.
|
default Optional<Argument<?>> |
getContainerElement()
If
BeanType.isContainerType() returns true this will return the container element. |
default Qualifier<T> |
getDeclaredQualifier()
Resolve the declared qualifier for this bean.
|
default Optional<Class<?>> |
getDeclaringType() |
default Collection<ExecutableMethod<T,?>> |
getExecutableMethods() |
default Collection<FieldInjectionPoint<T,?>> |
getInjectedFields()
All the fields that require injection.
|
default Collection<MethodInjectionPoint<T,?>> |
getInjectedMethods()
All methods that require injection.
|
default String |
getName() |
default Collection<MethodInjectionPoint<T,?>> |
getPostConstructMethods()
All the methods that should be called once the bean has been fully initialized and constructed.
|
default Collection<MethodInjectionPoint<T,?>> |
getPreDestroyMethods()
All the methods that should be called when the object is to be destroyed.
|
default Collection<Class<?>> |
getRequiredComponents() |
default <R> ExecutableMethod<T,R> |
getRequiredMethod(String name,
Class<?>... argumentTypes)
Finds a single
ExecutableMethod for the given name and argument types. |
default Optional<Class<? extends Annotation>> |
getScope() |
default Optional<String> |
getScopeName() |
default List<Argument<?>> |
getTypeArguments()
If the bean itself declares any type arguments this method will return the classes that represent those types.
|
default List<Argument<?>> |
getTypeArguments(Class<?> type)
Return the type arguments for the given interface or super type for this bean.
|
default List<Argument<?>> |
getTypeArguments(String type)
Return the type arguments for the given interface or super type for this bean.
|
default Class<?>[] |
getTypeParameters()
Returns the type parameters as a class array for the bean type.
|
default Class<?>[] |
getTypeParameters(Class<?> type)
Returns the type parameters as a class array for the given type.
|
default T |
inject(BeanContext context,
T bean)
Inject the given bean with the context.
|
default T |
inject(BeanResolutionContext resolutionContext,
BeanContext context,
T bean)
Inject the given bean with the context.
|
default boolean |
isAbstract() |
default boolean |
isCandidateBean(Argument<?> beanType)
Return whether this bean type is a candidate for dependency injection for the passed type.
|
default boolean |
isIterable() |
default boolean |
isProvided()
Deprecated.
Provided beans are deprecated
|
default boolean |
isProxy()
Whether this bean definition represents a proxy.
|
default boolean |
isSingleton() |
default Qualifier<T> |
resolveDynamicQualifier() |
booleanValue, booleanValue, booleanValue, booleanValue, classValue, classValue, classValue, classValue, classValues, classValues, classValues, classValues, 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, getAnnotationValuesByType, getDeclaredAnnotation, getDeclaredAnnotation, getDeclaredAnnotationNameByStereotype, getDeclaredAnnotationNames, getDeclaredAnnotationNamesByStereotype, getDeclaredAnnotationTypeByStereotype, getDeclaredAnnotationTypeByStereotype, getDeclaredAnnotationValuesByType, getDeclaredMetadata, getDefaultValue, getDefaultValue, getDefaultValue, getDefaultValue, getDefaultValues, 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
getAnnotationValuesByName, getDeclaredAnnotationValuesByName, getValues, hasDeclaredStereotype, isAnnotationPresent, isDeclaredAnnotationPresent
getExposedTypes, isContainerType, isPrimary, requiresMethodProcessing
getAnnotationMetadata
isEnabled, isEnabled
static final String NAMED_ATTRIBUTE
default Optional<Class<? extends Annotation>> getScope()
default boolean isSingleton()
default Optional<Argument<?>> getContainerElement()
BeanType.isContainerType()
returns true this will return the container element.default boolean isCandidateBean(@Nullable Argument<?> beanType)
BeanType
isCandidateBean
in interface BeanType<T>
beanType
- The bean type@Deprecated default boolean isProvided()
Provided
default boolean isIterable()
EachProperty
or
EachBean
Class<T> getBeanType()
BeanType
getBeanType
in interface BeanType<T>
default Optional<Class<?>> getDeclaringType()
default ConstructorInjectionPoint<T> getConstructor()
default Collection<Class<?>> getRequiredComponents()
default Collection<MethodInjectionPoint<T,?>> getInjectedMethods()
default Collection<FieldInjectionPoint<T,?>> getInjectedFields()
default Collection<MethodInjectionPoint<T,?>> getPostConstructMethods()
default Collection<MethodInjectionPoint<T,?>> getPreDestroyMethods()
default <R> Optional<ExecutableMethod<T,R>> findMethod(String name, Class<?>... argumentTypes)
ExecutableMethod
for the given name and argument types.R
- The return typename
- The method nameargumentTypes
- The argument typesExecutableMethod
default <R> Stream<ExecutableMethod<T,R>> findPossibleMethods(String name)
R
- The return typename
- The method namedefault T inject(BeanContext context, T bean)
context
- The contextbean
- The beandefault T inject(BeanResolutionContext resolutionContext, BeanContext context, T bean)
resolutionContext
- the resolution contextcontext
- The contextbean
- The beandefault Collection<ExecutableMethod<T,?>> getExecutableMethods()
ExecutableMethod
instances for this definition@NonNull default Argument<T> asArgument()
asArgument
in interface ArgumentCoercible<T>
default boolean isProxy()
@NonNull default List<Argument<?>> getTypeArguments()
@NonNull default List<Argument<?>> getTypeArguments(Class<?> type)
type
- The super class or interface type@NonNull default Class<?>[] getTypeParameters(@Nullable Class<?> type)
type
- The type@NonNull default Class<?>[] getTypeParameters()
@NonNull default List<Argument<?>> getTypeArguments(String type)
type
- The super class or interface typedefault <R> ExecutableMethod<T,R> getRequiredMethod(String name, Class<?>... argumentTypes)
ExecutableMethod
for the given name and argument types.R
- The return typename
- The method nameargumentTypes
- The argument typesExecutableMethod
IllegalStateException
- If the method cannot be founddefault boolean isAbstract()
@Nullable default Qualifier<T> getDeclaredQualifier()