T
- The bean typepublic interface BeanDefinition<T> extends AnnotationMetadataDelegate, Named, BeanType<T>
Modifier and Type | Field and Description |
---|---|
static java.lang.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 |
---|---|
<R> java.util.Optional<ExecutableMethod<T,R>> |
findMethod(java.lang.String name,
java.lang.Class... argumentTypes)
Finds a single
ExecutableMethod for the given name and argument types. |
<R> java.util.stream.Stream<ExecutableMethod<T,R>> |
findPossibleMethods(java.lang.String name)
Finds possible methods for the given method name.
|
java.lang.Class<T> |
getBeanType()
Returns the bean type.
|
ConstructorInjectionPoint<T> |
getConstructor()
The single concrete constructor that is an injection point for creating the bean.
|
default Qualifier<T> |
getDeclaredQualifier()
Resolve the declared qualifier for this bean.
|
java.util.Optional<java.lang.Class<?>> |
getDeclaringType() |
java.util.Collection<ExecutableMethod<T,?>> |
getExecutableMethods() |
java.util.Collection<FieldInjectionPoint> |
getInjectedFields()
All the fields that require injection.
|
java.util.Collection<MethodInjectionPoint> |
getInjectedMethods()
All methods that require injection.
|
java.lang.String |
getName() |
java.util.Collection<MethodInjectionPoint> |
getPostConstructMethods()
All the methods that should be called once the bean has been fully initialized and constructed.
|
java.util.Collection<MethodInjectionPoint> |
getPreDestroyMethods()
All the methods that should be called when the object is to be destroyed.
|
java.util.Collection<java.lang.Class> |
getRequiredComponents() |
default <R> ExecutableMethod<T,R> |
getRequiredMethod(java.lang.String name,
java.lang.Class... argumentTypes)
Finds a single
ExecutableMethod for the given name and argument types. |
java.util.Optional<java.lang.Class<? extends java.lang.annotation.Annotation>> |
getScope() |
default java.util.List<Argument<?>> |
getTypeArguments()
If the bean itself declares any type arguments this method will return the classes that represent those types.
|
default java.util.List<Argument<?>> |
getTypeArguments(java.lang.Class<?> type)
Return the type arguments for the given interface or super type for this bean.
|
default java.util.List<Argument<?>> |
getTypeArguments(java.lang.String type)
Return the type arguments for the given interface or super type for this bean.
|
default java.lang.Class[] |
getTypeParameters()
Returns the type parameters as a class array for the bean type.
|
default java.lang.Class[] |
getTypeParameters(java.lang.Class<?> type)
Returns the type parameters as a class array for the given type.
|
T |
inject(BeanContext context,
T bean)
Inject the given bean with the context.
|
T |
inject(BeanResolutionContext resolutionContext,
BeanContext context,
T bean)
Inject the given bean with the context.
|
default boolean |
isAbstract() |
boolean |
isIterable() |
boolean |
isProvided() |
default boolean |
isProxy()
Whether this bean definition represents a proxy.
|
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, getAnnotation, getAnnotation, getAnnotationNameByStereotype, getAnnotationNameByStereotype, getAnnotationNames, getAnnotationNamesByStereotype, getAnnotationNamesByStereotype, getAnnotationType, getAnnotationTypeByStereotype, getAnnotationTypeByStereotype, getAnnotationTypesByStereotype, getAnnotationValuesByType, getDeclaredAnnotation, getDeclaredAnnotation, getDeclaredAnnotationNameByStereotype, getDeclaredAnnotationNames, getDeclaredAnnotationNamesByStereotype, getDeclaredAnnotationTypeByStereotype, getDeclaredAnnotationTypeByStereotype, getDeclaredAnnotationValuesByType, 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, hasSimpleAnnotation, hasSimpleDeclaredAnnotation, hasStereotype, hasStereotype, hasStereotype, hasStereotype, intValue, intValue, intValue, isAnnotationPresent, isDeclaredAnnotationPresent, isEmpty, isFalse, isFalse, isPresent, isPresent, isTrue, isTrue, longValue, longValue, stringValue, stringValue, stringValue, stringValue, stringValues, stringValues, synthesize, synthesizeAll, synthesizeAnnotationsByType, synthesizeDeclared, synthesizeDeclared, synthesizeDeclaredAnnotationsByType
isPrimary, requiresMethodProcessing
getAnnotationMetadata
isEnabled, isEnabled
static final java.lang.String NAMED_ATTRIBUTE
java.util.Optional<java.lang.Class<? extends java.lang.annotation.Annotation>> getScope()
boolean isSingleton()
boolean isProvided()
boolean isIterable()
EachProperty
or
EachBean
java.lang.Class<T> getBeanType()
BeanType
getBeanType
in interface BeanType<T>
java.util.Optional<java.lang.Class<?>> getDeclaringType()
ConstructorInjectionPoint<T> getConstructor()
java.util.Collection<java.lang.Class> getRequiredComponents()
java.util.Collection<MethodInjectionPoint> getInjectedMethods()
java.util.Collection<FieldInjectionPoint> getInjectedFields()
java.util.Collection<MethodInjectionPoint> getPostConstructMethods()
java.util.Collection<MethodInjectionPoint> getPreDestroyMethods()
java.lang.String getName()
<R> java.util.Optional<ExecutableMethod<T,R>> findMethod(java.lang.String name, java.lang.Class... argumentTypes)
ExecutableMethod
for the given name and argument types.R
- The return typename
- The method nameargumentTypes
- The argument typesExecutableMethod
<R> java.util.stream.Stream<ExecutableMethod<T,R>> findPossibleMethods(java.lang.String name)
R
- The return typename
- The method nameT inject(BeanContext context, T bean)
context
- The contextbean
- The beanT inject(BeanResolutionContext resolutionContext, BeanContext context, T bean)
resolutionContext
- the resolution contextcontext
- The contextbean
- The beanjava.util.Collection<ExecutableMethod<T,?>> getExecutableMethods()
ExecutableMethod
instances for this definitiondefault boolean isProxy()
@NonNull default java.util.List<Argument<?>> getTypeArguments()
@NonNull default java.util.List<Argument<?>> getTypeArguments(java.lang.Class<?> type)
type
- The super class or interface type@NonNull default java.lang.Class[] getTypeParameters(@Nullable java.lang.Class<?> type)
type
- The type@NonNull default java.lang.Class[] getTypeParameters()
@NonNull default java.util.List<Argument<?>> getTypeArguments(java.lang.String type)
type
- The super class or interface typedefault <R> ExecutableMethod<T,R> getRequiredMethod(java.lang.String name, java.lang.Class... argumentTypes)
ExecutableMethod
for the given name and argument types.R
- The return typename
- The method nameargumentTypes
- The argument typesExecutableMethod
java.lang.IllegalStateException
- If the method cannot be founddefault boolean isAbstract()
@Nullable default Qualifier<T> getDeclaredQualifier()