T
- The Bean definition type@Internal public class AbstractBeanDefinition<T> extends Object implements BeanDefinition<T>, EnvironmentConfigurable
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 BeanDefinitionWriter
class can be used to produce bean definitions at
compile or runtime
BeanDefinitionWriter
Modifier and Type | Field and Description |
---|---|
protected Map<io.micronaut.context.AbstractBeanDefinition.MethodKey,ExecutableMethod<T,?>> |
executableMethodMap |
protected List<FieldInjectionPoint<T,?>> |
fieldInjectionPoints |
protected List<MethodInjectionPoint<T,?>> |
methodInjectionPoints |
protected List<MethodInjectionPoint<T,?>> |
postConstructMethods |
protected List<MethodInjectionPoint<T,?>> |
preDestroyMethods |
CLASS_NAME_SUFFIX, EMPTY_METADATA, VALUE_MEMBER
EMPTY
Modifier | Constructor and Description |
---|---|
protected |
AbstractBeanDefinition(Class<T> type,
AnnotationMetadata constructorAnnotationMetadata,
boolean requiresReflection,
Argument... arguments)
Constructs a bean for the given type.
|
protected |
AbstractBeanDefinition(Class<T> producedType,
Class<?> declaringType,
String fieldName,
AnnotationMetadata fieldMetadata,
boolean isFinal)
Constructs a bean definition that is produced from a method call on another type (factory bean).
|
protected |
AbstractBeanDefinition(Class<T> producedType,
Class<?> declaringType,
String methodName,
AnnotationMetadata methodMetadata,
boolean requiresReflection,
Argument<?>... arguments)
Constructs a bean definition that is produced from a method call on another type (factory bean).
|
Modifier and Type | Method and Description |
---|---|
protected AbstractBeanDefinition<T> |
addExecutableMethod(ExecutableMethod<T,?> executableMethod)
Adds a new
ExecutableMethod . |
protected AbstractBeanDefinition |
addInjectionPoint(Class declaringType,
Class fieldType,
String field,
AnnotationMetadata annotationMetadata,
Argument[] typeArguments,
boolean requiresReflection)
Adds an injection point for a field.
|
protected AbstractBeanDefinition |
addInjectionPoint(Class declaringType,
String method,
Argument[] arguments,
AnnotationMetadata annotationMetadata,
boolean requiresReflection)
Adds an injection point for a method that cannot be resolved at runtime, but a compile time produced injection
point exists.
|
protected AbstractBeanDefinition |
addPostConstruct(Class declaringType,
String method,
Argument[] arguments,
AnnotationMetadata annotationMetadata,
boolean requiresReflection)
Adds a post construct method definition.
|
protected AbstractBeanDefinition |
addPreDestroy(Class declaringType,
String method,
Argument[] arguments,
AnnotationMetadata annotationMetadata,
boolean requiresReflection)
Adds a pre destroy method definition.
|
void |
configure(Environment environment)
Configures the bean for the given
BeanContext . |
protected boolean |
containsProperties(BeanResolutionContext resolutionContext,
BeanContext context)
If this bean is a
ConfigurationProperties bean return whether any properties for it are configured
within the context. |
protected boolean |
containsProperties(BeanResolutionContext resolutionContext,
BeanContext context,
String subProperty)
If this bean is a
ConfigurationProperties bean return whether any properties for it are configured
within the context. |
protected boolean |
containsValueForField(BeanResolutionContext resolutionContext,
BeanContext context,
int fieldIndex)
Obtains a value for the given field argument.
|
protected boolean |
containsValueForMethodArgument(BeanResolutionContext resolutionContext,
BeanContext context,
int methodIndex,
int argIndex)
Obtains a value for the given method argument.
|
boolean |
equals(Object o) |
protected Optional |
findBeanForConstructorArgument(BeanResolutionContext resolutionContext,
BeanContext context,
ConstructorInjectionPoint<T> constructorInjectionPoint,
Argument argument)
Obtains all bean definitions for a constructor argument at the given index
|
protected Optional |
findBeanForField(BeanResolutionContext resolutionContext,
BeanContext context,
FieldInjectionPoint injectionPoint)
Obtains a an optional for the field at the given index and the argument at the given index
|
protected Optional |
findBeanForMethodArgument(BeanResolutionContext resolutionContext,
BeanContext context,
MethodInjectionPoint injectionPoint,
Argument argument)
Obtains an optional bean for the method at the given index and the argument at the given index
|
<R> Optional<ExecutableMethod<T,R>> |
findMethod(String name,
Class<?>... argumentTypes)
Finds a single
ExecutableMethod for the given name and argument types. |
Stream<ExecutableMethod<T,?>> |
findPossibleMethods(String name)
Finds possible methods for the given method name.
|
AnnotationMetadata |
getAnnotationMetadata()
Supplies the metadata.
|
protected Object |
getBeanForConstructorArgument(BeanResolutionContext resolutionContext,
BeanContext context,
int argIndex)
Obtains a bean definition for a constructor at the given index
|
protected Object |
getBeanForField(BeanResolutionContext resolutionContext,
BeanContext context,
FieldInjectionPoint injectionPoint)
Resolves a bean for the given
FieldInjectionPoint . |
protected Object |
getBeanForField(BeanResolutionContext resolutionContext,
BeanContext context,
int fieldIndex)
Obtains a bean definition for the field at the given index and the argument at the given index
|
protected Object |
getBeanForMethodArgument(BeanResolutionContext resolutionContext,
BeanContext context,
int methodIndex,
int argIndex)
Obtains a bean definition for the method at the given index and the argument at the given index
|
protected BeanRegistration<?> |
getBeanRegistrationForConstructorArgument(BeanResolutionContext resolutionContext,
BeanContext context,
int argIndex)
Obtains a bean registration for a method injection point.
|
protected BeanRegistration<?> |
getBeanRegistrationForField(BeanResolutionContext resolutionContext,
BeanContext context,
int fieldIndex)
Obtains a bean registration for a field injection point.
|
protected BeanRegistration<?> |
getBeanRegistrationForMethodArgument(BeanResolutionContext resolutionContext,
BeanContext context,
int methodIndex,
int argIndex)
Obtains a bean registration for a method injection point.
|
protected Object |
getBeanRegistrationsForConstructorArgument(BeanResolutionContext resolutionContext,
BeanContext context,
int argumentIndex)
Obtains all bean definitions for a constructor argument at the given index
|
protected Object |
getBeanRegistrationsForField(BeanResolutionContext resolutionContext,
BeanContext context,
int fieldIndex)
Obtains all bean definitions for a field injection point.
|
protected Object |
getBeanRegistrationsForMethodArgument(BeanResolutionContext resolutionContext,
BeanContext context,
int methodIndex,
int argIndex)
Obtains all bean definitions for a method injection point.
|
protected Collection |
getBeansOfTypeForConstructorArgument(BeanResolutionContext resolutionContext,
BeanContext context,
ConstructorInjectionPoint<T> constructorInjectionPoint,
Argument argument)
Obtains all bean definitions for a constructor argument at the given index.
|
protected Object |
getBeansOfTypeForConstructorArgument(BeanResolutionContext resolutionContext,
BeanContext context,
int argumentIndex)
Obtains all bean definitions for a constructor argument at the given index.
|
protected Collection |
getBeansOfTypeForField(BeanResolutionContext resolutionContext,
BeanContext context,
FieldInjectionPoint injectionPoint)
Obtains a bean definition for the field at the given index and the argument at the given index
|
protected Object |
getBeansOfTypeForField(BeanResolutionContext resolutionContext,
BeanContext context,
int fieldIndex)
Obtains all bean definitions for the field at the given index.
|
protected Object |
getBeansOfTypeForMethodArgument(BeanResolutionContext resolutionContext,
BeanContext context,
int methodIndex,
int argumentIndex)
Obtains all bean definitions for a constructor argument at the given index.
|
protected Collection |
getBeansOfTypeForMethodArgument(BeanResolutionContext resolutionContext,
BeanContext context,
MethodInjectionPoint injectionPoint,
Argument argument)
Obtains all bean definitions for the method at the given index and the argument at the given index
|
Class<T> |
getBeanType()
Returns the bean type.
|
ConstructorInjectionPoint<T> |
getConstructor()
The single concrete constructor that is an injection point for creating the bean.
|
Optional<Argument<?>> |
getContainerElement()
If
BeanType.isContainerType() returns true this will return the container element. |
Optional<Class<?>> |
getDeclaringType() |
Collection<ExecutableMethod<T,?>> |
getExecutableMethods() |
Set<Class<?>> |
getExposedTypes()
Returns a potentially limited subset of bean types exposed by this bean.
|
Collection<FieldInjectionPoint<T,?>> |
getInjectedFields()
All the fields that require injection.
|
Collection<MethodInjectionPoint<T,?>> |
getInjectedMethods()
All methods that require injection.
|
String |
getName() |
Collection<MethodInjectionPoint<T,?>> |
getPostConstructMethods()
All the methods that should be called once the bean has been fully initialized and constructed.
|
Collection<MethodInjectionPoint<T,?>> |
getPreDestroyMethods()
All the methods that should be called when the object is to be destroyed.
|
protected Object |
getProxiedBean(BeanContext beanContext)
Resolves the proxied bean instance for this bean.
|
Collection<Class<?>> |
getRequiredComponents() |
Optional<Class<? extends Annotation>> |
getScope() |
Optional<String> |
getScopeName() |
protected Stream |
getStreamOfTypeForField(BeanResolutionContext resolutionContext,
BeanContext context,
FieldInjectionPoint injectionPoint)
Obtains a bean definition for the field at the given index and the argument at the given index
|
List<Argument<?>> |
getTypeArguments(String type)
Return the type arguments for the given interface or super type for this bean.
|
protected Map<String,Argument<?>[]> |
getTypeArgumentsMap()
A method that subclasses can override to provide information on type arguments.
|
protected Object |
getValueForConstructorArgument(BeanResolutionContext resolutionContext,
BeanContext context,
int argIndex)
Obtains a value for a bean definition for a constructor at the given index
|
protected Object |
getValueForField(BeanResolutionContext resolutionContext,
BeanContext context,
int fieldIndex)
Obtains a value for the given field from the bean context
|
protected Object |
getValueForMethodArgument(BeanResolutionContext resolutionContext,
BeanContext context,
int methodIndex,
int argIndex)
Obtains a value for the given method argument.
|
protected <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.
|
protected <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.
|
int |
hashCode() |
boolean |
hasPropertyExpressions()
Does the metadata contain any property expressions like
${foo.bar} . |
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.
|
protected Object |
injectAnother(BeanResolutionContext resolutionContext,
BeanContext context,
Object bean)
Inject another bean, for example one created via factory.
|
protected Object |
injectBean(BeanResolutionContext resolutionContext,
BeanContext context,
Object bean)
The default implementation which provides no injection.
|
protected void |
injectBeanField(BeanResolutionContext resolutionContext,
DefaultBeanContext context,
int index,
Object bean)
Injects the value of a field of a bean that requires reflection.
|
protected void |
injectBeanMethod(BeanResolutionContext resolutionContext,
DefaultBeanContext context,
int methodIndex,
Object bean)
Inject a bean method that requires reflection.
|
boolean |
isAbstract() |
boolean |
isEnabled(BeanContext context,
BeanResolutionContext resolutionContext)
Return whether this component is enabled for the given context.
|
boolean |
isIterable() |
boolean |
isPrimary() |
boolean |
isProvided() |
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.
|
protected AnnotationMetadata |
resolveAnnotationMetadata()
Resolves the annotation metadata for this bean.
|
protected Stream |
streamOfTypeForConstructorArgument(BeanResolutionContext resolutionContext,
BeanContext context,
ConstructorInjectionPoint<T> constructorInjectionPoint,
Argument argument)
Obtains all bean definitions for a constructor argument at the given index
|
protected Stream |
streamOfTypeForMethodArgument(BeanResolutionContext resolutionContext,
BeanContext context,
MethodInjectionPoint injectionPoint,
Argument argument)
Obtains all bean definitions for the method at the given index and the argument at the given index
|
String |
toString() |
protected void |
warn(String message)
Allows printing warning messages produced by the compiler.
|
protected void |
warnMissingProperty(Class type,
String method,
String property)
Allows printing warning messages produced by the compiler.
|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
asArgument, getDeclaredQualifier, getRequiredMethod, getTypeArguments, getTypeArguments, getTypeParameters, getTypeParameters, isCandidateBean, isProxy, isSingleton, 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, 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
isContainerType, requiresMethodProcessing
isEnabled, isEnabled
protected final List<MethodInjectionPoint<T,?>> methodInjectionPoints
protected final List<FieldInjectionPoint<T,?>> fieldInjectionPoints
protected List<MethodInjectionPoint<T,?>> postConstructMethods
protected List<MethodInjectionPoint<T,?>> preDestroyMethods
protected Map<io.micronaut.context.AbstractBeanDefinition.MethodKey,ExecutableMethod<T,?>> executableMethodMap
@Internal protected AbstractBeanDefinition(Class<T> producedType, Class<?> declaringType, String fieldName, AnnotationMetadata fieldMetadata, boolean isFinal)
producedType
- The produced typedeclaringType
- The declaring type of the methodfieldName
- The method namefieldMetadata
- The metadata for the methodisFinal
- Is the field final@Internal protected AbstractBeanDefinition(Class<T> producedType, Class<?> declaringType, String methodName, AnnotationMetadata methodMetadata, boolean requiresReflection, Argument<?>... arguments)
producedType
- The produced typedeclaringType
- The declaring type of the methodmethodName
- The method namemethodMetadata
- The metadata for the methodrequiresReflection
- Whether reflection is required to invoke the methodarguments
- The method arguments@Internal protected AbstractBeanDefinition(Class<T> type, AnnotationMetadata constructorAnnotationMetadata, boolean requiresReflection, Argument... arguments)
type
- The typeconstructorAnnotationMetadata
- The annotation metadata for the constructorrequiresReflection
- Whether reflection is requiredarguments
- The constructor arguments used to build the beanpublic Optional<Argument<?>> getContainerElement()
BeanDefinition
BeanType.isContainerType()
returns true this will return the container element.getContainerElement
in interface BeanDefinition<T>
public final boolean hasPropertyExpressions()
AnnotationMetadata
${foo.bar}
. Note
this by default returns true
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.hasPropertyExpressions
in interface EnvironmentConfigurable
hasPropertyExpressions
in interface AnnotationMetadata
hasPropertyExpressions
in interface AnnotationMetadataDelegate
@NonNull public List<Argument<?>> getTypeArguments(String type)
BeanDefinition
getTypeArguments
in interface BeanDefinition<T>
type
- The super class or interface type@NonNull public AnnotationMetadata getAnnotationMetadata()
AnnotationMetadataProvider
AnnotationMetadata.EMPTY_METADATA
.getAnnotationMetadata
in interface AnnotationMetadataProvider
AnnotationMetadata
public boolean isAbstract()
isAbstract
in interface BeanDefinition<T>
public boolean isIterable()
isIterable
in interface BeanDefinition<T>
EachProperty
or
EachBean
public boolean isPrimary()
public <R> Optional<ExecutableMethod<T,R>> findMethod(String name, Class<?>... argumentTypes)
BeanDefinition
ExecutableMethod
for the given name and argument types.findMethod
in interface BeanDefinition<T>
R
- The return typename
- The method nameargumentTypes
- The argument typesExecutableMethod
public Stream<ExecutableMethod<T,?>> findPossibleMethods(String name)
BeanDefinition
findPossibleMethods
in interface BeanDefinition<T>
name
- The method namepublic boolean isProvided()
isProvided
in interface BeanDefinition<T>
Provided
public Optional<Class<? extends Annotation>> getScope()
getScope
in interface BeanDefinition<T>
public Optional<String> getScopeName()
getScopeName
in interface BeanDefinition<T>
public final Class<T> getBeanType()
BeanType
getBeanType
in interface BeanDefinition<T>
getBeanType
in interface BeanType<T>
@NonNull public final Set<Class<?>> getExposedTypes()
BeanType
Type
annotation.getExposedTypes
in interface BeanType<T>
public final Optional<Class<?>> getDeclaringType()
getDeclaringType
in interface BeanDefinition<T>
public final ConstructorInjectionPoint<T> getConstructor()
BeanDefinition
getConstructor
in interface BeanDefinition<T>
public Collection<Class<?>> getRequiredComponents()
getRequiredComponents
in interface BeanDefinition<T>
public final Collection<MethodInjectionPoint<T,?>> getInjectedMethods()
BeanDefinition
getInjectedMethods
in interface BeanDefinition<T>
public final Collection<FieldInjectionPoint<T,?>> getInjectedFields()
BeanDefinition
getInjectedFields
in interface BeanDefinition<T>
public final Collection<MethodInjectionPoint<T,?>> getPostConstructMethods()
BeanDefinition
getPostConstructMethods
in interface BeanDefinition<T>
public final Collection<MethodInjectionPoint<T,?>> getPreDestroyMethods()
BeanDefinition
getPreDestroyMethods
in interface BeanDefinition<T>
public T inject(BeanContext context, T bean)
BeanDefinition
inject
in interface BeanDefinition<T>
context
- The contextbean
- The beanpublic T inject(BeanResolutionContext resolutionContext, BeanContext context, T bean)
BeanDefinition
inject
in interface BeanDefinition<T>
resolutionContext
- the resolution contextcontext
- The contextbean
- The beanpublic Collection<ExecutableMethod<T,?>> getExecutableMethods()
getExecutableMethods
in interface BeanDefinition<T>
ExecutableMethod
instances for this definition@Internal public final void configure(Environment environment)
BeanContext
. If the context features an
Environment
this method configures the annotation metadata such that
environment aware values are returned.configure
in interface EnvironmentConfigurable
environment
- The environment@Internal protected final void warn(String message)
message
- The message@Internal protected final void warnMissingProperty(Class type, String method, String property)
type
- The typemethod
- The methodproperty
- The property@Internal protected final Object getProxiedBean(BeanContext beanContext)
beanContext
- The BeanContext
@Internal protected final AbstractBeanDefinition<T> addExecutableMethod(ExecutableMethod<T,?> executableMethod)
ExecutableMethod
.executableMethod
- The method@Internal protected final AbstractBeanDefinition addInjectionPoint(Class declaringType, Class fieldType, String field, @Nullable AnnotationMetadata annotationMetadata, @Nullable Argument[] typeArguments, boolean requiresReflection)
declaringType
- The declaring typefieldType
- The field typefield
- The name of the fieldannotationMetadata
- The annotation metadata for the fieldtypeArguments
- The argumentsrequiresReflection
- Whether reflection is required@Internal protected final AbstractBeanDefinition addInjectionPoint(Class declaringType, String method, @Nullable Argument[] arguments, @Nullable AnnotationMetadata annotationMetadata, boolean requiresReflection)
declaringType
- The declaring typemethod
- The methodarguments
- The argument typesannotationMetadata
- The annotation metadatarequiresReflection
- Whether the method requires reflection to invoke@Internal protected final AbstractBeanDefinition addPostConstruct(Class declaringType, String method, @Nullable Argument[] arguments, @Nullable AnnotationMetadata annotationMetadata, boolean requiresReflection)
declaringType
- The declaring typemethod
- The methodarguments
- The argumentsannotationMetadata
- The annotation metadatarequiresReflection
- Whether the method requires reflection@Internal protected final AbstractBeanDefinition addPreDestroy(Class declaringType, String method, Argument[] arguments, AnnotationMetadata annotationMetadata, boolean requiresReflection)
declaringType
- The declaring typemethod
- The methodarguments
- The argumentsannotationMetadata
- The annotation metadatarequiresReflection
- Whether the method requires reflection@Internal protected Object injectBean(BeanResolutionContext resolutionContext, BeanContext context, Object bean)
resolutionContext
- The resolution contextcontext
- The bean contextbean
- The bean@Internal protected Object injectAnother(BeanResolutionContext resolutionContext, BeanContext context, Object bean)
resolutionContext
- The reslution contextcontext
- The contextbean
- The bean@Internal protected Object postConstruct(BeanResolutionContext resolutionContext, BeanContext context, Object bean)
resolutionContext
- The resolution hookcontext
- The contextbean
- The beanprotected Object preDestroy(BeanResolutionContext resolutionContext, BeanContext context, Object bean)
resolutionContext
- The resolution hookcontext
- The contextbean
- The bean@Internal protected void injectBeanMethod(BeanResolutionContext resolutionContext, DefaultBeanContext context, int methodIndex, Object bean)
resolutionContext
- The resolution contextcontext
- The bean contextmethodIndex
- The method indexbean
- The bean@Internal protected final void injectBeanField(BeanResolutionContext resolutionContext, DefaultBeanContext context, int index, Object bean)
resolutionContext
- The resolution contextcontext
- The bean contextindex
- The index of the fieldbean
- The bean being injected@Internal protected final Object getValueForMethodArgument(BeanResolutionContext resolutionContext, BeanContext context, int methodIndex, int argIndex)
resolutionContext
- The resolution contextcontext
- The bean contextmethodIndex
- The method indexargIndex
- The argument index@Internal protected final boolean containsValueForMethodArgument(BeanResolutionContext resolutionContext, BeanContext context, int methodIndex, int argIndex)
resolutionContext
- The resolution contextcontext
- The bean contextmethodIndex
- The method indexargIndex
- The argument index@Internal protected final Object getBeanForMethodArgument(BeanResolutionContext resolutionContext, BeanContext context, int methodIndex, int argIndex)
Warning: this method is used by internal generated code and should not be called by user code.
resolutionContext
- The resolution contextcontext
- The contextmethodIndex
- The method indexargIndex
- The argument index@Internal protected final Collection getBeansOfTypeForMethodArgument(BeanResolutionContext resolutionContext, BeanContext context, MethodInjectionPoint injectionPoint, Argument argument)
Warning: this method is used by internal generated code and should not be called by user code.
resolutionContext
- The resolution contextcontext
- The contextinjectionPoint
- The method injection pointargument
- The argument@Internal protected final Optional findBeanForMethodArgument(BeanResolutionContext resolutionContext, BeanContext context, MethodInjectionPoint injectionPoint, Argument argument)
Warning: this method is used by internal generated code and should not be called by user code.
resolutionContext
- The resolution contextcontext
- The contextinjectionPoint
- The method injection pointargument
- The argument@Internal protected final Stream streamOfTypeForMethodArgument(BeanResolutionContext resolutionContext, BeanContext context, MethodInjectionPoint injectionPoint, Argument argument)
Warning: this method is used by internal generated code and should not be called by user code.
resolutionContext
- The resolution contextcontext
- The contextinjectionPoint
- The method injection pointargument
- The argument@Internal protected final Object getBeanForConstructorArgument(BeanResolutionContext resolutionContext, BeanContext context, int argIndex)
Warning: this method is used by internal generated code and should not be called by user code.
resolutionContext
- The resolution contextcontext
- The contextargIndex
- The argument index@Internal protected final Object getValueForConstructorArgument(BeanResolutionContext resolutionContext, BeanContext context, int argIndex)
Warning: this method is used by internal generated code and should not be called by user code.
resolutionContext
- The resolution contextcontext
- The contextargIndex
- The argument index@Internal protected final Collection getBeansOfTypeForConstructorArgument(BeanResolutionContext resolutionContext, BeanContext context, ConstructorInjectionPoint<T> constructorInjectionPoint, Argument argument)
resolutionContext
- The resolution contextcontext
- The contextconstructorInjectionPoint
- The constructor injection pointargument
- The argument@Internal protected final Object getBeansOfTypeForConstructorArgument(BeanResolutionContext resolutionContext, BeanContext context, int argumentIndex)
resolutionContext
- The resolution contextcontext
- The contextargumentIndex
- The argument index@Internal protected final Object getBeansOfTypeForMethodArgument(BeanResolutionContext resolutionContext, BeanContext context, int methodIndex, int argumentIndex)
resolutionContext
- The resolution contextcontext
- The contextmethodIndex
- The method indexargumentIndex
- The argument index@Internal protected final Object getBeansOfTypeForField(BeanResolutionContext resolutionContext, BeanContext context, int fieldIndex)
resolutionContext
- The resolution contextcontext
- The contextfieldIndex
- The field index@Internal protected final Object getBeanRegistrationsForConstructorArgument(BeanResolutionContext resolutionContext, BeanContext context, int argumentIndex)
Warning: this method is used by internal generated code and should not be called by user code.
resolutionContext
- The resolution contextcontext
- The contextargumentIndex
- The argument index@Internal protected final BeanRegistration<?> getBeanRegistrationForConstructorArgument(BeanResolutionContext resolutionContext, BeanContext context, int argIndex)
Warning: this method is used by internal generated code and should not be called by user code.
resolutionContext
- The resolution contextcontext
- The contextargIndex
- The arg index@Internal protected final Object getBeanRegistrationsForField(BeanResolutionContext resolutionContext, BeanContext context, int fieldIndex)
Warning: this method is used by internal generated code and should not be called by user code.
resolutionContext
- The resolution contextcontext
- The contextfieldIndex
- The field index@Internal protected final BeanRegistration<?> getBeanRegistrationForField(BeanResolutionContext resolutionContext, BeanContext context, int fieldIndex)
Warning: this method is used by internal generated code and should not be called by user code.
resolutionContext
- The resolution contextcontext
- The contextfieldIndex
- The field index@Internal protected final Object getBeanRegistrationsForMethodArgument(BeanResolutionContext resolutionContext, BeanContext context, int methodIndex, int argIndex)
Warning: this method is used by internal generated code and should not be called by user code.
resolutionContext
- The resolution contextcontext
- The contextmethodIndex
- The method indexargIndex
- The arg index@Internal protected final BeanRegistration<?> getBeanRegistrationForMethodArgument(BeanResolutionContext resolutionContext, BeanContext context, int methodIndex, int argIndex)
Warning: this method is used by internal generated code and should not be called by user code.
resolutionContext
- The resolution contextcontext
- The contextmethodIndex
- The method indexargIndex
- The arg index@Internal protected final Stream streamOfTypeForConstructorArgument(BeanResolutionContext resolutionContext, BeanContext context, ConstructorInjectionPoint<T> constructorInjectionPoint, Argument argument)
Warning: this method is used by internal generated code and should not be called by user code.
resolutionContext
- The resolution contextcontext
- The contextconstructorInjectionPoint
- The constructor injection pointargument
- The argument@Internal protected final Optional findBeanForConstructorArgument(BeanResolutionContext resolutionContext, BeanContext context, ConstructorInjectionPoint<T> constructorInjectionPoint, Argument argument)
Warning: this method is used by internal generated code and should not be called by user code.
resolutionContext
- The resolution contextcontext
- The contextconstructorInjectionPoint
- The constructor injection pointargument
- The argument@Internal protected final Object getBeanForField(BeanResolutionContext resolutionContext, BeanContext context, int fieldIndex)
Warning: this method is used by internal generated code and should not be called by user code.
resolutionContext
- The resolution contextcontext
- The contextfieldIndex
- The field index@Internal protected final Object getValueForField(BeanResolutionContext resolutionContext, BeanContext context, int fieldIndex)
Warning: this method is used by internal generated code and should not be called by user code.
resolutionContext
- The resolution contextcontext
- The contextfieldIndex
- The index of the field@Internal protected final <T1> Optional<T1> getValueForPath(BeanResolutionContext resolutionContext, BeanContext context, Argument<T1> propertyType, String... propertyPath)
T1
- The generic typeresolutionContext
- The resolution contextcontext
- The bean contextpropertyType
- The required property typepropertyPath
- The property path@Internal protected final <T1> Optional<T1> getValueForPath(BeanResolutionContext resolutionContext, BeanContext context, Argument<T1> propertyType, String propertyPath)
T1
- The generic typeresolutionContext
- The resolution contextcontext
- The bean contextpropertyType
- The required property typepropertyPath
- The property path@Internal protected final boolean containsValueForField(BeanResolutionContext resolutionContext, BeanContext context, int fieldIndex)
resolutionContext
- The resolution contextcontext
- The bean contextfieldIndex
- The field index@Internal protected final boolean containsProperties(BeanResolutionContext resolutionContext, BeanContext context)
ConfigurationProperties
bean return whether any properties for it are configured
within the context.resolutionContext
- the resolution contextcontext
- The context@Internal protected final boolean containsProperties(BeanResolutionContext resolutionContext, BeanContext context, String subProperty)
ConfigurationProperties
bean return whether any properties for it are configured
within the context.resolutionContext
- the resolution contextcontext
- The contextsubProperty
- The subproperty to check@Internal protected final Object getBeanForField(BeanResolutionContext resolutionContext, BeanContext context, FieldInjectionPoint injectionPoint)
FieldInjectionPoint
.resolutionContext
- The BeanResolutionContext
context
- The BeanContext
injectionPoint
- The FieldInjectionPoint
DependencyInjectionException
- If the bean cannot be resolved@Internal protected final Optional findBeanForField(BeanResolutionContext resolutionContext, BeanContext context, FieldInjectionPoint injectionPoint)
Warning: this method is used by internal generated code and should not be called by user code.
resolutionContext
- The resolution contextcontext
- The contextinjectionPoint
- The field injection point@Internal protected final Collection getBeansOfTypeForField(BeanResolutionContext resolutionContext, BeanContext context, FieldInjectionPoint injectionPoint)
Warning: this method is used by internal generated code and should not be called by user code.
resolutionContext
- The resolution contextcontext
- The contextinjectionPoint
- The field injection point@Internal protected final Stream getStreamOfTypeForField(BeanResolutionContext resolutionContext, BeanContext context, FieldInjectionPoint injectionPoint)
Warning: this method is used by internal generated code and should not be called by user code.
resolutionContext
- The resolution contextcontext
- The contextinjectionPoint
- The field injection point@Internal protected Map<String,Argument<?>[]> getTypeArgumentsMap()
protected AnnotationMetadata resolveAnnotationMetadata()
AnnotationMetadata
public boolean isEnabled(@NonNull BeanContext context, @Nullable BeanResolutionContext resolutionContext)
BeanContextConditional
isEnabled
in interface BeanContextConditional
context
- The contextresolutionContext
- The bean resolution context