Class AbstractInitializableBeanDefinition<T>
- Type Parameters:
T
- The Bean definition type
- All Implemented Interfaces:
BeanContextConfigurable
,EnvironmentConfigurable
,AnnotationMetadata
,AnnotationMetadataDelegate
,AnnotationMetadataProvider
,AnnotationSource
,BeanInfo<T>
,Named
,Ordered
,ArgumentCoercible<T>
,BeanContextConditional
,BeanDefinition<T>
,BeanType<T>
,InjectableBeanDefinition<T>
,InstantiatableBeanDefinition<T>
,QualifiedBeanType<T>
- Direct Known Subclasses:
AbstractInitializableBeanDefinitionAndReference
Default implementation of the BeanDefinition
interface. This class is generally not used directly in user
code.
Instead a build time tool does analysis of source code and dynamically produces subclasses of this class containing
information about the available injection points for a given class.
For technical reasons the class has to be marked as public, but is regarded as internal and should be used by compiler tools and plugins (such as AST transformation frameworks)
The io.micronaut.inject.writer.BeanDefinitionWriter
class can be used to produce bean definitions at
compile or runtime
- Since:
- 3.0
- Author:
- Graeme Rocher, Denis Stepanov
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
The data class containing annotation injection information.static final class
The data class containing all filed reference information.static class
The shared data class between method and field reference.static final class
The data class containing all method reference information.static final record
-
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
Fields inherited from interface io.micronaut.core.order.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
-
Constructor Summary
ModifierConstructorDescriptionprotected
AbstractInitializableBeanDefinition
(Class<T> beanType, @Nullable AbstractInitializableBeanDefinition.MethodOrFieldReference constructor, @Nullable AnnotationMetadata annotationMetadata, @Nullable AbstractInitializableBeanDefinition.MethodReference[] methodInjection, @Nullable AbstractInitializableBeanDefinition.FieldReference[] fieldInjection, @Nullable AbstractInitializableBeanDefinition.AnnotationReference[] annotationInjection, @Nullable ExecutableMethodsDefinition<T> executableMethodsDefinition, @Nullable Map<String, Argument<?>[]> typeArgumentsMap, @NonNull AbstractInitializableBeanDefinition.PrecalculatedInfo precalculatedInfo) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
checkIfShouldLoad
(BeanResolutionContext resolutionContext, BeanContext context) Checks whether the bean should be loaded.protected final void
checkInjectedBeanPropertyValue
(String injectedBeanPropertyName, @Nullable Object beanPropertyValue, @Nullable String requiredValue, @Nullable String notEqualsValue) Check the value of the injected bean property to decide whether the bean should be loaded.void
configure
(BeanContext beanContext) Configure the component for the given bean context.final void
configure
(Environment environment) Configures the bean for the givenBeanContext
.protected final boolean
containsProperties
(BeanResolutionContext resolutionContext, BeanContext context) If this bean is aConfigurationProperties
bean return whether any properties for it are configured within the context.protected final boolean
containsProperties
(BeanResolutionContext resolutionContext, BeanContext context, String subProperty) If this bean is aConfigurationProperties
bean return whether any properties for it are configured within the context.protected final boolean
containsPropertiesValue
(BeanResolutionContext resolutionContext, BeanContext context, String value) protected final boolean
containsPropertyValue
(BeanResolutionContext resolutionContext, BeanContext context, String value) protected final boolean
containsValueForField
(BeanResolutionContext resolutionContext, BeanContext context, int fieldIndex, boolean isValuePrefix) Deprecated.protected final boolean
containsValueForMethodArgument
(BeanResolutionContext resolutionContext, BeanContext context, int methodIndex, int argIndex, boolean isValuePrefix) Deprecated.protected T
doInstantiate
(BeanResolutionContext resolutionContext, BeanContext context, Map<String, Object> requiredArgumentValues) Method to be implemented by the generated code if the bean definition is implementingParametrizedInstantiatableBeanDefinition
.boolean
protected final <K> Optional<K>
findBeanForConstructorArgument
(BeanResolutionContext resolutionContext, BeanContext context, int argIndex, Argument<K> genericType, Qualifier<K> qualifier) Obtains all bean definitions for a constructor argument at the given indexprotected final <K> Optional<K>
findBeanForField
(BeanResolutionContext resolutionContext, BeanContext context, int fieldIndex, Argument<K> genericType, Qualifier<K> qualifier) Obtains an optional for the field at the given index and the argument at the given indexprotected final <K> Optional<K>
findBeanForMethodArgument
(BeanResolutionContext resolutionContext, BeanContext context, int methodIndex, int argIndex, Argument<K> genericType, Qualifier<K> qualifier) Obtains an optional bean for the method at the given index and the argument at the given indexfinal <R> Optional<ExecutableMethod<T,
R>> findMethod
(String name, Class<?>... argumentTypes) Finds a singleExecutableMethod
for the given name and argument types.final <R> Stream<ExecutableMethod<T,
R>> findPossibleMethods
(String name) Finds possible methods for the given method name.Supplies the metadata.protected final <K> K
getBeanForAnnotation
(BeanResolutionContext resolutionContext, BeanContext context, int annotationBeanIndex, Qualifier<K> qualifier) protected final Object
getBeanForConstructorArgument
(BeanResolutionContext resolutionContext, BeanContext context, int argIndex, Qualifier qualifier) Obtains a bean definition for a constructor at the given indexprotected final <K> K
getBeanForField
(BeanResolutionContext resolutionContext, BeanContext context, int fieldIndex, Qualifier<K> qualifier) Obtains a bean definition for the field at the given index and the argument at the given indexprotected final <K> K
getBeanForMethodArgument
(BeanResolutionContext resolutionContext, BeanContext context, int methodIndex, int argIndex, Qualifier<K> qualifier) Obtains a bean definition for the method at the given index and the argument at the given indexprotected final Object
getBeanForSetter
(BeanResolutionContext resolutionContext, BeanContext context, String setterName, Argument argument, Qualifier qualifier) Obtains a bean definition for the method at the given index and the argument at the given indexprotected final <K> BeanRegistration<K>
getBeanRegistrationForConstructorArgument
(BeanResolutionContext resolutionContext, BeanContext context, int argumentIndex, Argument<K> genericType, Qualifier<K> qualifier) Obtains a bean registration for a method injection point.protected final <K> BeanRegistration<K>
getBeanRegistrationForField
(BeanResolutionContext resolutionContext, BeanContext context, int fieldIndex, Argument<K> genericType, Qualifier<K> qualifier) Obtains a bean registration for a field injection point.protected final <K> BeanRegistration<K>
getBeanRegistrationForMethodArgument
(BeanResolutionContext resolutionContext, BeanContext context, int methodIndex, int argIndex, Argument<K> genericType, Qualifier<K> qualifier) Obtains a bean registration for a method injection point.protected final <K,
R extends Collection<BeanRegistration<K>>>
RgetBeanRegistrationsForConstructorArgument
(BeanResolutionContext resolutionContext, BeanContext context, int argumentIndex, Argument<K> genericType, Qualifier<K> qualifier) Obtains all bean definitions for a constructor argument at the given indexprotected final <K,
R extends Collection<BeanRegistration<K>>>
RgetBeanRegistrationsForField
(BeanResolutionContext resolutionContext, BeanContext context, int fieldIndex, Argument<K> genericType, Qualifier<K> qualifier) Obtains all bean definitions for a field injection point.protected final <K,
R extends Collection<BeanRegistration<K>>>
RgetBeanRegistrationsForMethodArgument
(BeanResolutionContext resolutionContext, BeanContext context, int methodIndex, int argIndex, Argument<K> genericType, Qualifier<K> qualifier) Obtains all bean definitions for a method injection point.protected final Collection<Object>
getBeansOfTypeForConstructorArgument
(BeanResolutionContext resolutionContext, BeanContext context, int argumentIndex, Argument genericType, Qualifier qualifier) Obtains all bean definitions for a constructor argument at the given index.protected final <K,
R extends Collection<K>>
ObjectgetBeansOfTypeForField
(BeanResolutionContext resolutionContext, BeanContext context, int fieldIndex, Argument<K> genericType, Qualifier<K> qualifier) Obtains all bean definitions for the field at the given index.protected final <K,
R extends Collection<K>>
RgetBeansOfTypeForMethodArgument
(BeanResolutionContext resolutionContext, BeanContext context, int methodIndex, int argumentIndex, Argument<K> genericType, Qualifier<K> qualifier) Obtains all bean definitions for a method argument at the given index.protected final Collection<Object>
getBeansOfTypeForSetter
(BeanResolutionContext resolutionContext, BeanContext context, String setterName, Argument argument, Argument genericType, Qualifier qualifier) Obtains all bean definitions for a method argument at the given index.Returns the bean type.final ConstructorInjectionPoint<T>
The single concrete constructor that is an injection point for creating the bean.IfBeanType.isContainerType()
returns true this will return the container element.Resolve the declared qualifier for this bean.protected final Object
getEvaluatedExpressionValueForConstructorArgument
(int argIndex) protected final Object
getEvaluatedExpressionValueForMethodArgument
(int methodIndex, int argIndex) final Collection<ExecutableMethod<T,
?>> Returns a potentially limited subset of bean types exposed by this bean.final List<FieldInjectionPoint<T,
?>> All the fields that require injection.final List<MethodInjectionPoint<T,
?>> All methods that require injection.getMapOfTypeForConstructorArgument
(BeanResolutionContext resolutionContext, BeanContext context, int argIndex, Argument<V> genericType, Qualifier<V> qualifier) Obtains all bean definitions for a constructor argument at the given indexgetMapOfTypeForField
(BeanResolutionContext resolutionContext, BeanContext context, int fieldIndex, Argument<V> genericType, Qualifier<V> qualifier) Obtains a bean definition for the field at the given index and the argument at the given indexgetMapOfTypeForMethodArgument
(BeanResolutionContext resolutionContext, BeanContext context, int methodIndex, int argIndex, Argument<V> genericType, Qualifier<V> qualifier) Obtains all bean definitions for the method at the given index and the argument at the given indexgetName()
final List<MethodInjectionPoint<T,
?>> All the methods that should be called once the bean has been fully initialized and constructed.final List<MethodInjectionPoint<T,
?>> All the methods that should be called when the object is to be destroyed.protected final Object
getPropertyPlaceholderValueForConstructorArgument
(BeanResolutionContext resolutionContext, BeanContext context, int argIndex, String propertyValue) Obtains a property value for a bean definition for a constructor at the given indexprotected final Object
getPropertyPlaceholderValueForField
(BeanResolutionContext resolutionContext, BeanContext context, Argument argument, String placeholder) Deprecated.protected final Object
getPropertyPlaceholderValueForMethodArgument
(BeanResolutionContext resolutionContext, BeanContext context, int methodIndex, int argIndex, String value) Obtains a placeholder value for the given method argument.protected final Object
getPropertyPlaceholderValueForSetter
(BeanResolutionContext resolutionContext, BeanContext context, String setterName, Argument<?> argument, String value) Obtains a placeholder value for the given method argument.protected final Object
getPropertyValueForConstructorArgument
(BeanResolutionContext resolutionContext, BeanContext context, int argIndex, String propertyValue, String cliProperty) Obtains a property value for a bean definition for a constructor at the given indexprotected final Object
getPropertyValueForField
(BeanResolutionContext resolutionContext, BeanContext context, Argument argument, String propertyValue, String cliProperty) Deprecated.protected final Object
getPropertyValueForMethodArgument
(BeanResolutionContext resolutionContext, BeanContext context, int methodIndex, int argIndex, String propertyValue, String cliProperty) Obtains a property value for the given method argument.protected final Object
getPropertyValueForSetter
(BeanResolutionContext resolutionContext, BeanContext context, String setterName, Argument<?> argument, String propertyValue, String cliProperty) Obtains a property value for the given method argument.final Argument<?>[]
Implementing possibleParametrizedInstantiatableBeanDefinition.getRequiredArguments()
.final Collection<Class<?>>
final Optional<Class<? extends Annotation>>
getScope()
protected final <K> Stream<K>
getStreamOfTypeForConstructorArgument
(BeanResolutionContext resolutionContext, BeanContext context, int argIndex, Argument<K> genericType, Qualifier<K> qualifier) Obtains all bean definitions for a constructor argument at the given indexprotected final <K> Stream<K>
getStreamOfTypeForField
(BeanResolutionContext resolutionContext, BeanContext context, int fieldIndex, Argument<K> genericType, Qualifier<K> qualifier) Obtains a bean definition for the field at the given index and the argument at the given indexprotected final Stream<?>
getStreamOfTypeForMethodArgument
(BeanResolutionContext resolutionContext, BeanContext context, int methodIndex, int argIndex, Argument genericType, Qualifier qualifier) Obtains all bean definitions for the method at the given index and the argument at the given indexgetTypeArguments
(String type) Return the type arguments for the given interface or super type for this bean.protected final Object
getValueForConstructorArgument
(BeanResolutionContext resolutionContext, BeanContext context, int argIndex, Qualifier qualifier) Deprecated.protected final Object
getValueForField
(BeanResolutionContext resolutionContext, BeanContext context, int fieldIndex, Qualifier qualifier) Deprecated.protected final Object
getValueForMethodArgument
(BeanResolutionContext resolutionContext, BeanContext context, int methodIndex, int argIndex, Qualifier qualifier) Deprecated.protected final <T1> Optional<T1>
getValueForPath
(BeanResolutionContext resolutionContext, BeanContext context, Argument<T1> propertyType, String propertyPath) Resolve a value for the given field of the given type and path.boolean
Does the metadata contain any evaluated expressions like#{ T(java.lang.Math).random() }
.int
hashCode()
final boolean
Does the metadata contain any property expressions like${foo.bar}
.inject
(BeanResolutionContext resolutionContext, BeanContext context, T bean) Inject the given bean with the context.final T
instantiate
(BeanResolutionContext resolutionContext, BeanContext context, Map<String, Object> requiredArgumentValues) Implementing possibleParametrizedInstantiatableBeanDefinition.instantiate(BeanResolutionContext, BeanContext)
.protected final void
invokeMethodWithReflection
(BeanResolutionContext resolutionContext, BeanContext context, int methodIndex, Object bean, Object[] methodArgs) Invoke a bean method that requires reflection.boolean
final boolean
final boolean
Checks whether the bean type is a container type.boolean
isEnabled
(@NonNull BeanContext context, @Nullable BeanResolutionContext resolutionContext) Return whether this component is enabled for the given context.protected boolean
isInnerConfiguration
(Class<?> clazz) Check if the class is an inner configuration.boolean
boolean
boolean
protected Object
postConstruct
(BeanResolutionContext resolutionContext, BeanContext context, Object bean) Default postConstruct hook that only invokes methods that require reflection.protected Object
preDestroy
(BeanResolutionContext resolutionContext, BeanContext context, Object bean) Default preDestroy hook that only invokes methods that require reflection.boolean
By default, when theBeanContext
is started, theBeanDefinition.getExecutableMethods()
are not processed by registeredExecutableMethodProcessor
instances unless this method returns true.protected final void
setFieldWithReflection
(BeanResolutionContext resolutionContext, BeanContext context, int index, Object object, Object value) Sets the value of a field of an object that requires reflection.toString()
protected final void
Deprecated, for removal: This API element is subject to removal in a future version.No longer usedprotected final void
warnMissingProperty
(Class type, String method, String property) Deprecated, for removal: This API element is subject to removal in a future version.No longer usedMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface io.micronaut.core.annotation.AnnotationMetadata
enumValuesSet, enumValuesSet, getValues, hasDeclaredStereotype, 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, 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.BeanContextConditional
isEnabled, isEnabled
Methods inherited from interface io.micronaut.inject.BeanDefinition
asArgument, getGenericBeanType, getRequiredMethod, getTypeArguments, getTypeArguments, getTypeParameters, getTypeParameters, hasAnnotatedMethod, isCandidateBean, isProxy, resolveDynamicQualifier
Methods inherited from interface io.micronaut.inject.BeanType
getBeanName
Methods inherited from interface io.micronaut.inject.InjectableBeanDefinition
inject
Methods inherited from interface io.micronaut.inject.InstantiatableBeanDefinition
instantiate, instantiate
-
Constructor Details
-
AbstractInitializableBeanDefinition
@Internal protected AbstractInitializableBeanDefinition(Class<T> beanType, @Nullable @Nullable AbstractInitializableBeanDefinition.MethodOrFieldReference constructor, @Nullable @Nullable AnnotationMetadata annotationMetadata, @Nullable @Nullable AbstractInitializableBeanDefinition.MethodReference[] methodInjection, @Nullable @Nullable AbstractInitializableBeanDefinition.FieldReference[] fieldInjection, @Nullable @Nullable AbstractInitializableBeanDefinition.AnnotationReference[] annotationInjection, @Nullable @Nullable ExecutableMethodsDefinition<T> executableMethodsDefinition, @Nullable @Nullable Map<String, Argument<?>[]> typeArgumentsMap, @NonNull @NonNull AbstractInitializableBeanDefinition.PrecalculatedInfo precalculatedInfo)
-
-
Method Details
-
getDeclaredQualifier
Description copied from interface:BeanDefinition
Resolve the declared qualifier for this bean.- Specified by:
getDeclaredQualifier
in interfaceBeanDefinition<T>
- Specified by:
getDeclaredQualifier
in interfaceQualifiedBeanType<T>
- Returns:
- The qualifier or null if this isn't one
-
isContainerType
public final boolean isContainerType()Description copied from interface:BeanType
Checks whether the bean type is a container type.- Specified by:
isContainerType
in interfaceBeanType<T>
- Returns:
- Whether the type is a container type like
Iterable
.
-
getContainerElement
Description copied from interface:BeanDefinition
IfBeanType.isContainerType()
returns true this will return the container element.- Specified by:
getContainerElement
in interfaceBeanDefinition<T>
- Returns:
- The container element.
-
hasPropertyExpressions
public final boolean hasPropertyExpressions()Description copied from interface:AnnotationMetadata
Does the metadata contain any property expressions like${foo.bar}
. Note this by default returnstrue
as previous versions of Micronaut must assume metadata is present. The compilation time this is computed in order to decide whether to instrument annotation metadata with environment specific logic.- Specified by:
hasPropertyExpressions
in interfaceAnnotationMetadata
- Specified by:
hasPropertyExpressions
in interfaceAnnotationMetadataDelegate
- Specified by:
hasPropertyExpressions
in interfaceEnvironmentConfigurable
- Returns:
- True if property expressions are present
-
hasEvaluatedExpressions
public boolean hasEvaluatedExpressions()Description copied from interface:AnnotationMetadata
Does the metadata contain any evaluated expressions like#{ T(java.lang.Math).random() }
.- Specified by:
hasEvaluatedExpressions
in interfaceAnnotationMetadata
- Returns:
- True if evaluated expressions are present
-
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
-
getAnnotationMetadata
Description copied from interface:AnnotationMetadataProvider
Supplies the metadata. Defaults toAnnotationMetadata.EMPTY_METADATA
.- Specified by:
getAnnotationMetadata
in interfaceAnnotationMetadataProvider
- Returns:
- The
AnnotationMetadata
-
isAbstract
public boolean isAbstract()- Specified by:
isAbstract
in interfaceBeanDefinition<T>
- Returns:
- Whether the bean definition is abstract
-
isIterable
public boolean isIterable()- Specified by:
isIterable
in interfaceBeanDefinition<T>
- Returns:
- Whether the bean declared with
EachProperty
orEachBean
-
isConfigurationProperties
public final boolean isConfigurationProperties()- Specified by:
isConfigurationProperties
in interfaceBeanDefinition<T>
- Returns:
- Is the type configuration properties.
-
isPrimary
public boolean isPrimary() -
requiresMethodProcessing
public 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:
-
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
-
equals
-
hashCode
public int hashCode() -
toString
-
isSingleton
public boolean isSingleton()- Specified by:
isSingleton
in interfaceBeanDefinition<T>
- Returns:
- Whether the scope is singleton
-
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
-
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
-
getExposedTypes
Description copied from interface:BeanType
Returns a potentially limited subset of bean types exposed by this bean. The types to be exposed can be defined by theType
annotation.- Specified by:
getExposedTypes
in interfaceBeanType<T>
- Returns:
- The exposed types
-
getDeclaringType
- Specified by:
getDeclaringType
in interfaceBeanDefinition<T>
- Returns:
- The type that declares this definition, null if not applicable.
-
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
-
inject
Description copied from interface:InjectableBeanDefinition
Inject the given bean with the context.- Specified by:
inject
in interfaceInjectableBeanDefinition<T>
- Parameters:
resolutionContext
- the resolution contextcontext
- The contextbean
- The bean- Returns:
- The injected bean
-
getExecutableMethods
- Specified by:
getExecutableMethods
in interfaceBeanDefinition<T>
- Returns:
- The
ExecutableMethod
instances for this definition
-
configure
Configures the bean for the givenBeanContext
. If the context features anEnvironment
this method configures the annotation metadata such that environment aware values are returned.- Specified by:
configure
in interfaceEnvironmentConfigurable
- Parameters:
environment
- The environment
-
configure
Description copied from interface:BeanContextConfigurable
Configure the component for the given bean context.- Specified by:
configure
in interfaceBeanContextConfigurable
- Parameters:
beanContext
- The bean context
-
warn
Deprecated, for removal: This API element is subject to removal in a future version.No longer usedAllows printing warning messages produced by the compiler.- Parameters:
message
- The message
-
warnMissingProperty
@Internal @Deprecated(forRemoval=true, since="4.4.0") protected final void warnMissingProperty(Class type, String method, String property) Deprecated, for removal: This API element is subject to removal in a future version.No longer usedAllows printing warning messages produced by the compiler.- Parameters:
type
- The typemethod
- The methodproperty
- The property
-
getRequiredArguments
Implementing possibleParametrizedInstantiatableBeanDefinition.getRequiredArguments()
.- Returns:
- The arguments required to construct parametrized bean
-
instantiate
public final T instantiate(BeanResolutionContext resolutionContext, BeanContext context, Map<String, Object> requiredArgumentValues) throws BeanInstantiationExceptionImplementing possibleParametrizedInstantiatableBeanDefinition.instantiate(BeanResolutionContext, BeanContext)
.- Parameters:
resolutionContext
- TheBeanResolutionContext
context
- TheBeanContext
requiredArgumentValues
- The required arguments values. The keys should match the names of the arguments returned bygetRequiredArguments()
- Returns:
- The instantiated bean
- Throws:
BeanInstantiationException
- If the bean cannot be instantiated for the arguments supplied
-
doInstantiate
@Internal protected T doInstantiate(BeanResolutionContext resolutionContext, BeanContext context, Map<String, Object> requiredArgumentValues) Method to be implemented by the generated code if the bean definition is implementingParametrizedInstantiatableBeanDefinition
.- Parameters:
resolutionContext
- The resolution contextcontext
- The bean contextrequiredArgumentValues
- The required arguments- Returns:
- The built instance
-
postConstruct
@Internal protected Object postConstruct(BeanResolutionContext resolutionContext, BeanContext context, Object bean) Default postConstruct hook that only invokes methods that require reflection. Generated subclasses should override to call methods that don't require reflection.- Parameters:
resolutionContext
- The resolution hookcontext
- The contextbean
- The bean- Returns:
- The bean
-
preDestroy
@Internal protected Object preDestroy(BeanResolutionContext resolutionContext, BeanContext context, Object bean) Default preDestroy hook that only invokes methods that require reflection. Generated subclasses should override to call methods that don't require reflection.- Parameters:
resolutionContext
- The resolution hookcontext
- The contextbean
- The bean- Returns:
- The bean
-
isInnerConfiguration
Check if the class is an inner configuration.- Parameters:
clazz
- The class to check- Returns:
- true if the inner configuration
-
checkIfShouldLoad
@Internal protected void checkIfShouldLoad(BeanResolutionContext resolutionContext, BeanContext context) Checks whether the bean should be loaded.- Parameters:
resolutionContext
- - the resolution contextcontext
- - the bean context
-
checkInjectedBeanPropertyValue
@Internal protected final void checkInjectedBeanPropertyValue(String injectedBeanPropertyName, @Nullable @Nullable Object beanPropertyValue, @Nullable @Nullable String requiredValue, @Nullable @Nullable String notEqualsValue) Check the value of the injected bean property to decide whether the bean should be loaded.- Parameters:
injectedBeanPropertyName
- the name of the injected bean propertybeanPropertyValue
- the value of injected bean propertyrequiredValue
- the value which is required for the bean to be loadednotEqualsValue
- the value which bean property should not be equal to for the bean to be loaded
-
invokeMethodWithReflection
@Internal protected final void invokeMethodWithReflection(BeanResolutionContext resolutionContext, BeanContext context, int methodIndex, Object bean, Object[] methodArgs) Invoke a bean method that requires reflection.- Parameters:
resolutionContext
- The resolution contextcontext
- The bean contextmethodIndex
- The method indexbean
- The beanmethodArgs
- The method args
-
setFieldWithReflection
@Internal protected final void setFieldWithReflection(BeanResolutionContext resolutionContext, BeanContext context, int index, Object object, Object value) Sets the value of a field of an object that requires reflection.- Parameters:
resolutionContext
- The resolution contextcontext
- The object contextindex
- The index of the fieldobject
- The object whose field should be modifievalue
- The instance being set
-
getValueForMethodArgument
@Internal @Deprecated protected final Object getValueForMethodArgument(BeanResolutionContext resolutionContext, BeanContext context, int methodIndex, int argIndex, Qualifier qualifier) Deprecated.Obtains a value for the given method argument.- Parameters:
resolutionContext
- The resolution contextcontext
- The bean contextmethodIndex
- The method indexargIndex
- The argument indexqualifier
- The qualifier- Returns:
- The value
-
getPropertyValueForMethodArgument
@Internal protected final Object getPropertyValueForMethodArgument(BeanResolutionContext resolutionContext, BeanContext context, int methodIndex, int argIndex, String propertyValue, String cliProperty) Obtains a property value for the given method argument.- Parameters:
resolutionContext
- The resolution contextcontext
- The bean contextmethodIndex
- The method indexargIndex
- The argument indexpropertyValue
- The property valuecliProperty
- The cli property- Returns:
- The value
-
getPropertyPlaceholderValueForMethodArgument
@Internal protected final Object getPropertyPlaceholderValueForMethodArgument(BeanResolutionContext resolutionContext, BeanContext context, int methodIndex, int argIndex, String value) Obtains a placeholder value for the given method argument.- Parameters:
resolutionContext
- The resolution contextcontext
- The bean contextmethodIndex
- The method indexargIndex
- The argument indexvalue
- The property value- Returns:
- The value
-
getEvaluatedExpressionValueForMethodArgument
-
getPropertyValueForSetter
@Internal protected final Object getPropertyValueForSetter(BeanResolutionContext resolutionContext, BeanContext context, String setterName, Argument<?> argument, String propertyValue, String cliProperty) Obtains a property value for the given method argument.- Parameters:
resolutionContext
- The resolution contextcontext
- The bean contextsetterName
- The setter nameargument
- The argumentpropertyValue
- The property valuecliProperty
- The cli property- Returns:
- The value
-
getPropertyPlaceholderValueForSetter
@Internal protected final Object getPropertyPlaceholderValueForSetter(BeanResolutionContext resolutionContext, BeanContext context, String setterName, Argument<?> argument, String value) Obtains a placeholder value for the given method argument.- Parameters:
resolutionContext
- The resolution contextcontext
- The bean contextsetterName
- The setter nameargument
- The argumentvalue
- The value- Returns:
- The value
-
containsValueForMethodArgument
@Internal @Deprecated protected final boolean containsValueForMethodArgument(BeanResolutionContext resolutionContext, BeanContext context, int methodIndex, int argIndex, boolean isValuePrefix) Deprecated.Obtains a value for the given method argument.- Parameters:
resolutionContext
- The resolution contextcontext
- The bean contextmethodIndex
- The method indexargIndex
- The argument indexisValuePrefix
- Is value prefix in cases when beans are requested- Returns:
- The value
-
getBeanForMethodArgument
@Internal protected final <K> K getBeanForMethodArgument(BeanResolutionContext resolutionContext, BeanContext context, int methodIndex, int argIndex, Qualifier<K> qualifier) Obtains a bean definition for the method at the given index and the argument at the given indexWarning: this method is used by internal generated code and should not be called by user code.
- Type Parameters:
K
- The bean type- Parameters:
resolutionContext
- The resolution contextcontext
- The contextmethodIndex
- The method indexargIndex
- The argument indexqualifier
- The qualifier- Returns:
- The resolved bean
-
getBeansOfTypeForMethodArgument
@Internal protected final <K,R extends Collection<K>> R getBeansOfTypeForMethodArgument(BeanResolutionContext resolutionContext, BeanContext context, int methodIndex, int argumentIndex, Argument<K> genericType, Qualifier<K> qualifier) Obtains all bean definitions for a method argument at the given index.- Type Parameters:
K
- The bean typeR
- The result collection type- Parameters:
resolutionContext
- The resolution contextcontext
- The contextmethodIndex
- The method indexargumentIndex
- The argument indexgenericType
- The generic typequalifier
- The qualifier- Returns:
- The resolved bean
-
getBeanForSetter
@Internal protected final Object getBeanForSetter(BeanResolutionContext resolutionContext, BeanContext context, String setterName, Argument argument, Qualifier qualifier) Obtains a bean definition for the method at the given index and the argument at the given indexWarning: this method is used by internal generated code and should not be called by user code.
- Parameters:
resolutionContext
- The resolution contextcontext
- The contextsetterName
- The setter nameargument
- The argumentqualifier
- The qualifier- Returns:
- The resolved bean
-
getBeansOfTypeForSetter
@Internal protected final Collection<Object> getBeansOfTypeForSetter(BeanResolutionContext resolutionContext, BeanContext context, String setterName, Argument argument, Argument genericType, Qualifier qualifier) Obtains all bean definitions for a method argument at the given index.- Parameters:
resolutionContext
- The resolution contextcontext
- The contextsetterName
- The setter nameargument
- The argumentgenericType
- The generic typequalifier
- The qualifier- Returns:
- The resolved bean
-
findBeanForMethodArgument
@Internal protected final <K> Optional<K> findBeanForMethodArgument(BeanResolutionContext resolutionContext, BeanContext context, int methodIndex, int argIndex, Argument<K> genericType, Qualifier<K> qualifier) Obtains an optional bean for the method at the given index and the argument at the given indexWarning: this method is used by internal generated code and should not be called by user code.
- Type Parameters:
K
- The bean type- Parameters:
resolutionContext
- The resolution contextcontext
- The contextmethodIndex
- The method indexargIndex
- The argument indexgenericType
- The generic typequalifier
- The qualifier- Returns:
- The resolved bean
-
getStreamOfTypeForMethodArgument
@Internal protected final Stream<?> getStreamOfTypeForMethodArgument(BeanResolutionContext resolutionContext, BeanContext context, int methodIndex, int argIndex, Argument genericType, Qualifier qualifier) Obtains all bean definitions for the method at the given index and the argument at the given indexWarning: this method is used by internal generated code and should not be called by user code.
- Parameters:
resolutionContext
- The resolution contextcontext
- The contextmethodIndex
- The method indexargIndex
- The argument indexgenericType
- The generic typequalifier
- The qualifier- Returns:
- The resolved bean
-
getMapOfTypeForMethodArgument
@Internal protected final <V> Map<String,V> getMapOfTypeForMethodArgument(BeanResolutionContext resolutionContext, BeanContext context, int methodIndex, int argIndex, Argument<V> genericType, Qualifier<V> qualifier) Obtains all bean definitions for the method at the given index and the argument at the given indexWarning: this method is used by internal generated code and should not be called by user code.
- Type Parameters:
V
- The bean type- Parameters:
resolutionContext
- The resolution contextcontext
- The contextmethodIndex
- The method indexargIndex
- The argument indexgenericType
- The generic typequalifier
- The qualifier- Returns:
- The resolved bean
-
getBeanForConstructorArgument
@Internal protected final Object getBeanForConstructorArgument(BeanResolutionContext resolutionContext, BeanContext context, int argIndex, Qualifier qualifier) Obtains a bean definition for a constructor at the given indexWarning: this method is used by internal generated code and should not be called by user code.
- Parameters:
resolutionContext
- The resolution contextcontext
- The contextargIndex
- The argument indexqualifier
- The qualifier- Returns:
- The resolved bean
-
getValueForConstructorArgument
@Internal @Deprecated protected final Object getValueForConstructorArgument(BeanResolutionContext resolutionContext, BeanContext context, int argIndex, Qualifier qualifier) Deprecated.Obtains a value for a bean definition for a constructor at the given indexWarning: this method is used by internal generated code and should not be called by user code.
- Parameters:
resolutionContext
- The resolution contextcontext
- The contextargIndex
- The argument indexqualifier
- The qualifier- Returns:
- The resolved bean
-
getPropertyValueForConstructorArgument
@Internal protected final Object getPropertyValueForConstructorArgument(BeanResolutionContext resolutionContext, BeanContext context, int argIndex, String propertyValue, String cliProperty) Obtains a property value for a bean definition for a constructor at the given indexWarning: this method is used by internal generated code and should not be called by user code.
- Parameters:
resolutionContext
- The resolution contextcontext
- The contextargIndex
- The argument indexpropertyValue
- The property valuecliProperty
- The cli property- Returns:
- The resolved bean
-
getEvaluatedExpressionValueForConstructorArgument
-
getPropertyPlaceholderValueForConstructorArgument
@Internal protected final Object getPropertyPlaceholderValueForConstructorArgument(BeanResolutionContext resolutionContext, BeanContext context, int argIndex, String propertyValue) Obtains a property value for a bean definition for a constructor at the given indexWarning: this method is used by internal generated code and should not be called by user code.
- Parameters:
resolutionContext
- The resolution contextcontext
- The contextargIndex
- The argument indexpropertyValue
- The property value- Returns:
- The resolved bean
-
getBeansOfTypeForConstructorArgument
@Internal protected final Collection<Object> getBeansOfTypeForConstructorArgument(BeanResolutionContext resolutionContext, BeanContext context, int argumentIndex, Argument genericType, Qualifier qualifier) Obtains all bean definitions for a constructor argument at the given index.- Parameters:
resolutionContext
- The resolution contextcontext
- The contextargumentIndex
- The argument indexgenericType
- The generic typequalifier
- The qualifier- Returns:
- The resolved bean
-
getBeanRegistrationsForConstructorArgument
@Internal protected final <K,R extends Collection<BeanRegistration<K>>> R getBeanRegistrationsForConstructorArgument(BeanResolutionContext resolutionContext, BeanContext context, int argumentIndex, Argument<K> genericType, Qualifier<K> qualifier) Obtains all bean definitions for a constructor argument at the given indexWarning: this method is used by internal generated code and should not be called by user code.
- Type Parameters:
K
- The bean typeR
- The result collection type- Parameters:
resolutionContext
- The resolution contextcontext
- The contextargumentIndex
- The argument indexgenericType
- The generic typequalifier
- The qualifier- Returns:
- The resolved bean
-
getBeanRegistrationForConstructorArgument
@Internal protected final <K> BeanRegistration<K> getBeanRegistrationForConstructorArgument(BeanResolutionContext resolutionContext, BeanContext context, int argumentIndex, Argument<K> genericType, Qualifier<K> qualifier) Obtains a bean registration for a method injection point.Warning: this method is used by internal generated code and should not be called by user code.
- Type Parameters:
K
- The bean type- Parameters:
resolutionContext
- The resolution contextcontext
- The contextargumentIndex
- The arg indexgenericType
- The generic typequalifier
- The qualifier- Returns:
- The resolved bean registration
-
getBeanRegistrationsForMethodArgument
@Internal protected final <K,R extends Collection<BeanRegistration<K>>> R getBeanRegistrationsForMethodArgument(BeanResolutionContext resolutionContext, BeanContext context, int methodIndex, int argIndex, Argument<K> genericType, Qualifier<K> qualifier) Obtains all bean definitions for a method injection point.Warning: this method is used by internal generated code and should not be called by user code.
- Type Parameters:
K
- The bean typeR
- The result collection type- Parameters:
resolutionContext
- The resolution contextcontext
- The contextmethodIndex
- The method indexargIndex
- The arg indexgenericType
- The generic typequalifier
- The qualifier- Returns:
- The resolved bean
-
getBeanRegistrationForMethodArgument
@Internal protected final <K> BeanRegistration<K> getBeanRegistrationForMethodArgument(BeanResolutionContext resolutionContext, BeanContext context, int methodIndex, int argIndex, Argument<K> genericType, Qualifier<K> qualifier) Obtains a bean registration for a method injection point.Warning: this method is used by internal generated code and should not be called by user code.
- Type Parameters:
K
- The bean type- Parameters:
resolutionContext
- The resolution contextcontext
- The contextmethodIndex
- The method indexargIndex
- The arg indexgenericType
- The generic typequalifier
- The qualifier- Returns:
- The resolved bean registration
-
getStreamOfTypeForConstructorArgument
@Internal protected final <K> Stream<K> getStreamOfTypeForConstructorArgument(BeanResolutionContext resolutionContext, BeanContext context, int argIndex, Argument<K> genericType, Qualifier<K> qualifier) Obtains all bean definitions for a constructor argument at the given indexWarning: this method is used by internal generated code and should not be called by user code.
- Type Parameters:
K
- The bean type- Parameters:
resolutionContext
- The resolution contextcontext
- The contextargIndex
- The argument indexgenericType
- The generic typequalifier
- The qualifier- Returns:
- The resolved bean
-
getMapOfTypeForConstructorArgument
@Internal protected final <V> Map<String,V> getMapOfTypeForConstructorArgument(BeanResolutionContext resolutionContext, BeanContext context, int argIndex, Argument<V> genericType, Qualifier<V> qualifier) Obtains all bean definitions for a constructor argument at the given indexWarning: this method is used by internal generated code and should not be called by user code.
- Type Parameters:
V
- The bean type- Parameters:
resolutionContext
- The resolution contextcontext
- The contextargIndex
- The argument indexgenericType
- The generic typequalifier
- The qualifier- Returns:
- The resolved bean
-
findBeanForConstructorArgument
@Internal protected final <K> Optional<K> findBeanForConstructorArgument(BeanResolutionContext resolutionContext, BeanContext context, int argIndex, Argument<K> genericType, Qualifier<K> qualifier) Obtains all bean definitions for a constructor argument at the given indexWarning: this method is used by internal generated code and should not be called by user code.
- Type Parameters:
K
- The bean type- Parameters:
resolutionContext
- The resolution contextcontext
- The contextargIndex
- The argument indexgenericType
- The generic typequalifier
- The qualifier- Returns:
- The resolved bean
-
getBeanForField
@Internal protected final <K> K getBeanForField(BeanResolutionContext resolutionContext, BeanContext context, int fieldIndex, Qualifier<K> qualifier) Obtains a bean definition for the field at the given index and the argument at the given indexWarning: this method is used by internal generated code and should not be called by user code.
- Type Parameters:
K
- The bean type- Parameters:
resolutionContext
- The resolution contextcontext
- The contextfieldIndex
- The field indexqualifier
- The qualifier- Returns:
- The resolved bean
-
getBeanForAnnotation
@Internal protected final <K> K getBeanForAnnotation(BeanResolutionContext resolutionContext, BeanContext context, int annotationBeanIndex, Qualifier<K> qualifier) -
getValueForField
@Internal @Deprecated protected final Object getValueForField(BeanResolutionContext resolutionContext, BeanContext context, int fieldIndex, Qualifier qualifier) Deprecated.Obtains a value for the given field from the bean contextWarning: this method is used by internal generated code and should not be called by user code.
- Parameters:
resolutionContext
- The resolution contextcontext
- The contextfieldIndex
- The index of the fieldqualifier
- The qualifier- Returns:
- The resolved bean
-
getPropertyValueForField
@Internal @Deprecated protected final Object getPropertyValueForField(BeanResolutionContext resolutionContext, BeanContext context, Argument argument, String propertyValue, String cliProperty) Deprecated.Obtains a property value for the given field from the bean contextWarning: this method is used by internal generated code and should not be called by user code.
- Parameters:
resolutionContext
- The resolution contextcontext
- The contextargument
- The argumentpropertyValue
- The property valuecliProperty
- The clie property name- Returns:
- The resolved bean
-
getPropertyPlaceholderValueForField
@Internal @Deprecated protected final Object getPropertyPlaceholderValueForField(BeanResolutionContext resolutionContext, BeanContext context, Argument argument, String placeholder) Deprecated.Obtains a property placeholder value for the given field from the bean contextWarning: this method is used by internal generated code and should not be called by user code.
- Parameters:
resolutionContext
- The resolution contextcontext
- The contextargument
- The argumentplaceholder
- The placeholder- Returns:
- The resolved bean
-
getValueForPath
@Internal protected final <T1> Optional<T1> getValueForPath(BeanResolutionContext resolutionContext, BeanContext context, Argument<T1> propertyType, String propertyPath) Resolve a value for the given field of the given type and path.- Type Parameters:
T1
- The generic type- Parameters:
resolutionContext
- The resolution contextcontext
- The bean contextpropertyType
- The required property typepropertyPath
- The property path- Returns:
- An optional value
-
containsValueForField
@Internal @Deprecated protected final boolean containsValueForField(BeanResolutionContext resolutionContext, BeanContext context, int fieldIndex, boolean isValuePrefix) Deprecated.Obtains a value for the given field argument.- Parameters:
resolutionContext
- The resolution contextcontext
- The bean contextfieldIndex
- The field indexisValuePrefix
- Is value prefix in cases when beans are requested- Returns:
- True if it does
-
containsProperties
@Internal protected final boolean containsProperties(BeanResolutionContext resolutionContext, BeanContext context) If this bean is aConfigurationProperties
bean return whether any properties for it are configured within the context.- Parameters:
resolutionContext
- the resolution contextcontext
- The context- Returns:
- True if it does
-
containsProperties
@Internal protected final boolean containsProperties(BeanResolutionContext resolutionContext, BeanContext context, String subProperty) If this bean is aConfigurationProperties
bean return whether any properties for it are configured within the context.- Parameters:
resolutionContext
- the resolution contextcontext
- The contextsubProperty
- The subproperty to check- Returns:
- True if it does
-
getBeansOfTypeForField
@Internal protected final <K,R extends Collection<K>> Object getBeansOfTypeForField(BeanResolutionContext resolutionContext, BeanContext context, int fieldIndex, Argument<K> genericType, Qualifier<K> qualifier) Obtains all bean definitions for the field at the given index.- Type Parameters:
K
- The bean typeR
- The result collection type- Parameters:
resolutionContext
- The resolution contextcontext
- The contextfieldIndex
- The field indexgenericType
- The generic typequalifier
- The qualifier- Returns:
- The resolved bean
-
getBeanRegistrationsForField
@Internal protected final <K,R extends Collection<BeanRegistration<K>>> R getBeanRegistrationsForField(BeanResolutionContext resolutionContext, BeanContext context, int fieldIndex, Argument<K> genericType, Qualifier<K> qualifier) Obtains all bean definitions for a field injection point.Warning: this method is used by internal generated code and should not be called by user code.
- Type Parameters:
K
- The bean typeR
- The result collection type- Parameters:
resolutionContext
- The resolution contextcontext
- The contextfieldIndex
- The field indexgenericType
- The generic typequalifier
- The qualifier- Returns:
- The resolved bean
-
getBeanRegistrationForField
@Internal protected final <K> BeanRegistration<K> getBeanRegistrationForField(BeanResolutionContext resolutionContext, BeanContext context, int fieldIndex, Argument<K> genericType, Qualifier<K> qualifier) Obtains a bean registration for a field injection point.Warning: this method is used by internal generated code and should not be called by user code.
- Type Parameters:
K
- The bean type- Parameters:
resolutionContext
- The resolution contextcontext
- The contextfieldIndex
- The field indexgenericType
- The generic typequalifier
- The qualifier- Returns:
- The resolved bean registration
-
findBeanForField
@Internal protected final <K> Optional<K> findBeanForField(BeanResolutionContext resolutionContext, BeanContext context, int fieldIndex, Argument<K> genericType, Qualifier<K> qualifier) Obtains an optional for the field at the given index and the argument at the given indexWarning: this method is used by internal generated code and should not be called by user code.
- Type Parameters:
K
- The bean type- Parameters:
resolutionContext
- The resolution contextcontext
- The contextfieldIndex
- The field indexgenericType
- The generic typequalifier
- The qualifier- Returns:
- The resolved bean
-
getStreamOfTypeForField
@Internal protected final <K> Stream<K> getStreamOfTypeForField(BeanResolutionContext resolutionContext, BeanContext context, int fieldIndex, Argument<K> genericType, Qualifier<K> qualifier) Obtains a bean definition for the field at the given index and the argument at the given indexWarning: this method is used by internal generated code and should not be called by user code.
- Type Parameters:
K
- The bean type- Parameters:
resolutionContext
- The resolution contextcontext
- The contextfieldIndex
- The field indexgenericType
- The generic typequalifier
- The qualifier- Returns:
- The resolved bean
-
getMapOfTypeForField
@Internal protected final <V> Map<String,V> getMapOfTypeForField(BeanResolutionContext resolutionContext, BeanContext context, int fieldIndex, Argument<V> genericType, Qualifier<V> qualifier) Obtains a bean definition for the field at the given index and the argument at the given indexWarning: this method is used by internal generated code and should not be called by user code.
- Type Parameters:
V
- The bean type- Parameters:
resolutionContext
- The resolution contextcontext
- The contextfieldIndex
- The field indexgenericType
- The generic typequalifier
- The qualifier- Returns:
- The resolved bean
-
containsPropertiesValue
@Internal protected final boolean containsPropertiesValue(BeanResolutionContext resolutionContext, BeanContext context, String value) -
containsPropertyValue
@Internal protected final boolean containsPropertyValue(BeanResolutionContext resolutionContext, BeanContext context, String value) -
isEnabled
public 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
-