T
- The Bean definition type@Internal public class AbstractBeanDefinition<T> extends java.lang.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 java.util.Map<io.micronaut.context.AbstractBeanDefinition.MethodKey,ExecutableMethod<T,?>> |
executableMethodMap |
protected java.util.List<FieldInjectionPoint> |
fieldInjectionPoints |
protected java.util.List<MethodInjectionPoint> |
methodInjectionPoints |
protected java.util.List<MethodInjectionPoint> |
postConstructMethods |
protected java.util.List<MethodInjectionPoint> |
preDestroyMethods |
CLASS_NAME_SUFFIX, EMPTY_METADATA, VALUE_MEMBER
EMPTY
Modifier | Constructor and Description |
---|---|
protected |
AbstractBeanDefinition(java.lang.Class<T> type,
AnnotationMetadata constructorAnnotationMetadata,
boolean requiresReflection,
Argument... arguments)
Constructs a bean for the given type.
|
protected |
AbstractBeanDefinition(java.lang.Class<T> producedType,
java.lang.Class<?> declaringType,
java.lang.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(java.lang.Class declaringType,
java.lang.Class fieldType,
java.lang.String field,
AnnotationMetadata annotationMetadata,
Argument[] typeArguments,
boolean requiresReflection)
Adds an injection point for a field.
|
protected AbstractBeanDefinition |
addInjectionPoint(java.lang.Class declaringType,
java.lang.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(java.lang.Class declaringType,
java.lang.String method,
Argument[] arguments,
AnnotationMetadata annotationMetadata,
boolean requiresReflection)
Adds a post construct method definition.
|
protected AbstractBeanDefinition |
addPreDestroy(java.lang.Class declaringType,
java.lang.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,
java.lang.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(java.lang.Object o) |
protected java.util.Optional |
findBeanForConstructorArgument(BeanResolutionContext resolutionContext,
BeanContext context,
ConstructorInjectionPoint<T> constructorInjectionPoint,
Argument argument)
Obtains all bean definitions for a constructor argument at the given index
|
protected java.util.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 java.util.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> java.util.Optional<ExecutableMethod<T,R>> |
findMethod(java.lang.String name,
java.lang.Class... argumentTypes)
Finds a single
ExecutableMethod for the given name and argument types. |
java.util.stream.Stream<ExecutableMethod<T,?>> |
findPossibleMethods(java.lang.String name)
Finds possible methods for the given method name.
|
AnnotationMetadata |
getAnnotationMetadata()
Supplies the metadata.
|
protected java.lang.Object |
getBeanForConstructorArgument(BeanResolutionContext resolutionContext,
BeanContext context,
int argIndex)
Obtains a bean definition for a constructor at the given index
|
protected java.lang.Object |
getBeanForField(BeanResolutionContext resolutionContext,
BeanContext context,
FieldInjectionPoint injectionPoint)
Resolves a bean for the given
FieldInjectionPoint . |
protected java.lang.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 java.lang.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 javax.inject.Provider |
getBeanProviderForConstructorArgument(BeanResolutionContext resolutionContext,
BeanContext context,
ConstructorInjectionPoint constructorInjectionPoint,
Argument argument)
Obtains a bean provider for a constructor at the given index
|
protected javax.inject.Provider |
getBeanProviderForField(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 javax.inject.Provider |
getBeanProviderForMethodArgument(BeanResolutionContext resolutionContext,
BeanContext context,
MethodInjectionPoint injectionPoint,
Argument argument)
Obtains a bean provider for the method at the given index and the argument at the given index
|
protected java.util.Collection |
getBeansOfTypeForConstructorArgument(BeanResolutionContext resolutionContext,
BeanContext context,
ConstructorInjectionPoint<T> constructorInjectionPoint,
Argument argument)
Obtains all bean definitions for a constructor argument at the given index
|
protected java.util.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 java.util.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
|
java.lang.Class<T> |
getBeanType()
Returns the bean type.
|
ConstructorInjectionPoint<T> |
getConstructor()
The single concrete constructor that is an injection point for creating the bean.
|
java.util.Optional<java.lang.Class<?>> |
getDeclaringType() |
java.util.Collection<ExecutableMethod<T,?>> |
getExecutableMethods() |
java.util.Collection<FieldInjectionPoint> |
getInjectedFields()
All the fields that require injection.
|
java.util.Collection<MethodInjectionPoint> |
getInjectedMethods()
All methods that require injection.
|
java.lang.String |
getName() |
java.util.Collection<MethodInjectionPoint> |
getPostConstructMethods()
All the methods that should be called once the bean has been fully initialized and constructed.
|
java.util.Collection<MethodInjectionPoint> |
getPreDestroyMethods()
All the methods that should be called when the object is to be destroyed.
|
protected java.lang.Object |
getProxiedBean(BeanContext beanContext)
Resolves the proxied bean instance for this bean.
|
java.util.Collection<java.lang.Class> |
getRequiredComponents() |
java.util.Optional<java.lang.Class<? extends java.lang.annotation.Annotation>> |
getScope() |
protected java.util.stream.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
|
java.util.List<Argument<?>> |
getTypeArguments(java.lang.String type)
Return the type arguments for the given interface or super type for this bean.
|
protected java.util.Map<java.lang.String,Argument<?>[]> |
getTypeArgumentsMap()
A method that subclasses can override to provide information on type arguments.
|
protected java.lang.Object |
getValueForConstructorArgument(BeanResolutionContext resolutionContext,
BeanContext context,
int argIndex)
Obtains a value for a bean definition for a constructor at the given index
|
protected java.lang.Object |
getValueForField(BeanResolutionContext resolutionContext,
BeanContext context,
int fieldIndex)
Obtains a value for the given field from the bean context
|
protected java.lang.Object |
getValueForMethodArgument(BeanResolutionContext resolutionContext,
BeanContext context,
int methodIndex,
int argIndex)
Obtains a value for the given method argument.
|
protected <T1> java.util.Optional<T1> |
getValueForPath(BeanResolutionContext resolutionContext,
BeanContext context,
Argument<T1> propertyType,
java.lang.String... propertyPath)
Resolve a value for the given field of the given type and path.
|
protected <T1> java.util.Optional<T1> |
getValueForPath(BeanResolutionContext resolutionContext,
BeanContext context,
Argument<T1> propertyType,
java.lang.String propertyPath)
Resolve a value for the given field of the given type and path.
|
int |
hashCode() |
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 java.lang.Object |
injectAnother(BeanResolutionContext resolutionContext,
BeanContext context,
java.lang.Object bean)
Inject another bean, for example one created via factory.
|
protected java.lang.Object |
injectBean(BeanResolutionContext resolutionContext,
BeanContext context,
java.lang.Object bean)
The default implementation which provides no injection.
|
protected void |
injectBeanField(BeanResolutionContext resolutionContext,
DefaultBeanContext context,
int index,
java.lang.Object bean)
Injects the value of a field of a bean that requires reflection.
|
protected void |
injectBeanMethod(BeanResolutionContext resolutionContext,
DefaultBeanContext context,
int methodIndex,
java.lang.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() |
boolean |
isSingleton() |
protected java.lang.Object |
postConstruct(BeanResolutionContext resolutionContext,
BeanContext context,
java.lang.Object bean)
Default postConstruct hook that only invokes methods that require reflection.
|
protected java.lang.Object |
preDestroy(BeanResolutionContext resolutionContext,
BeanContext context,
java.lang.Object bean)
Default preDestroy hook that only invokes methods that require reflection.
|
protected AnnotationMetadata |
resolveAnnotationMetadata()
Resolves the annotation metadata for this bean.
|
protected java.util.stream.Stream |
streamOfTypeForConstructorArgument(BeanResolutionContext resolutionContext,
BeanContext context,
ConstructorInjectionPoint<T> constructorInjectionPoint,
Argument argument)
Obtains all bean definitions for a constructor argument at the given index
|
protected java.util.stream.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
|
java.lang.String |
toString() |
protected void |
warn(java.lang.String message)
Allows printing warning messages produced by the compiler.
|
protected void |
warnMissingProperty(java.lang.Class type,
java.lang.String method,
java.lang.String property)
Allows printing warning messages produced by the compiler.
|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getDeclaredQualifier, getRequiredMethod, getTypeArguments, getTypeArguments, getTypeParameters, getTypeParameters, isProxy, resolveDynamicQualifier
booleanValue, booleanValue, booleanValue, booleanValue, classValue, classValue, classValue, classValue, classValues, classValues, classValues, classValues, doubleValue, doubleValue, doubleValue, enumValue, enumValue, enumValue, enumValue, enumValues, enumValues, enumValues, enumValues, findAnnotation, findAnnotation, findDeclaredAnnotation, findDeclaredAnnotation, getAnnotation, getAnnotation, getAnnotationNameByStereotype, getAnnotationNameByStereotype, getAnnotationNames, getAnnotationNamesByStereotype, getAnnotationNamesByStereotype, getAnnotationType, getAnnotationTypeByStereotype, getAnnotationTypeByStereotype, getAnnotationTypesByStereotype, getAnnotationValuesByType, getDeclaredAnnotation, getDeclaredAnnotation, getDeclaredAnnotationNameByStereotype, getDeclaredAnnotationNames, getDeclaredAnnotationNamesByStereotype, getDeclaredAnnotationTypeByStereotype, getDeclaredAnnotationTypeByStereotype, getDeclaredAnnotationValuesByType, getDefaultValue, getDefaultValue, getDefaultValue, getDefaultValue, getDefaultValues, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValues, getValues, hasAnnotation, hasAnnotation, hasDeclaredAnnotation, hasDeclaredAnnotation, hasDeclaredStereotype, hasDeclaredStereotype, hasDeclaredStereotype, hasSimpleAnnotation, hasSimpleDeclaredAnnotation, hasStereotype, hasStereotype, hasStereotype, hasStereotype, intValue, intValue, intValue, isAnnotationPresent, isDeclaredAnnotationPresent, isEmpty, isFalse, isFalse, isPresent, isPresent, isTrue, isTrue, longValue, longValue, stringValue, stringValue, stringValue, stringValue, stringValues, stringValues, synthesize, synthesizeAll, synthesizeAnnotationsByType, synthesizeDeclared, synthesizeDeclared, synthesizeDeclaredAnnotationsByType
requiresMethodProcessing
isEnabled, isEnabled
protected final java.util.List<MethodInjectionPoint> methodInjectionPoints
protected final java.util.List<FieldInjectionPoint> fieldInjectionPoints
protected java.util.List<MethodInjectionPoint> postConstructMethods
protected java.util.List<MethodInjectionPoint> preDestroyMethods
protected java.util.Map<io.micronaut.context.AbstractBeanDefinition.MethodKey,ExecutableMethod<T,?>> executableMethodMap
@Internal protected AbstractBeanDefinition(java.lang.Class<T> producedType, java.lang.Class<?> declaringType, java.lang.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(java.lang.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 bean@NonNull public java.util.List<Argument<?>> getTypeArguments(java.lang.String type)
BeanDefinition
getTypeArguments
in interface BeanDefinition<T>
type
- The super class or interface typepublic 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> java.util.Optional<ExecutableMethod<T,R>> findMethod(java.lang.String name, java.lang.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 java.util.stream.Stream<ExecutableMethod<T,?>> findPossibleMethods(java.lang.String name)
BeanDefinition
findPossibleMethods
in interface BeanDefinition<T>
name
- The method namepublic boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public boolean isProvided()
isProvided
in interface BeanDefinition<T>
public boolean isSingleton()
isSingleton
in interface BeanDefinition<T>
public java.util.Optional<java.lang.Class<? extends java.lang.annotation.Annotation>> getScope()
getScope
in interface BeanDefinition<T>
public final java.lang.Class<T> getBeanType()
BeanType
getBeanType
in interface BeanDefinition<T>
getBeanType
in interface BeanType<T>
public final java.util.Optional<java.lang.Class<?>> getDeclaringType()
getDeclaringType
in interface BeanDefinition<T>
public final ConstructorInjectionPoint<T> getConstructor()
BeanDefinition
getConstructor
in interface BeanDefinition<T>
public java.util.Collection<java.lang.Class> getRequiredComponents()
getRequiredComponents
in interface BeanDefinition<T>
public final java.util.Collection<MethodInjectionPoint> getInjectedMethods()
BeanDefinition
getInjectedMethods
in interface BeanDefinition<T>
public final java.util.Collection<FieldInjectionPoint> getInjectedFields()
BeanDefinition
getInjectedFields
in interface BeanDefinition<T>
public final java.util.Collection<MethodInjectionPoint> getPostConstructMethods()
BeanDefinition
getPostConstructMethods
in interface BeanDefinition<T>
public final java.util.Collection<MethodInjectionPoint> getPreDestroyMethods()
BeanDefinition
getPreDestroyMethods
in interface BeanDefinition<T>
public java.lang.String getName()
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 java.util.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(java.lang.String message)
message
- The message@Internal protected final void warnMissingProperty(java.lang.Class type, java.lang.String method, java.lang.String property)
type
- The typemethod
- The methodproperty
- The property@Internal protected final java.lang.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(java.lang.Class declaringType, java.lang.Class fieldType, java.lang.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(java.lang.Class declaringType, java.lang.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(java.lang.Class declaringType, java.lang.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(java.lang.Class declaringType, java.lang.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 java.lang.Object injectBean(BeanResolutionContext resolutionContext, BeanContext context, java.lang.Object bean)
resolutionContext
- The resolution contextcontext
- The bean contextbean
- The bean@Internal protected java.lang.Object injectAnother(BeanResolutionContext resolutionContext, BeanContext context, java.lang.Object bean)
resolutionContext
- The reslution contextcontext
- The contextbean
- The bean@Internal protected java.lang.Object postConstruct(BeanResolutionContext resolutionContext, BeanContext context, java.lang.Object bean)
resolutionContext
- The resolution hookcontext
- The contextbean
- The beanprotected java.lang.Object preDestroy(BeanResolutionContext resolutionContext, BeanContext context, java.lang.Object bean)
resolutionContext
- The resolution hookcontext
- The contextbean
- The bean@Internal protected void injectBeanMethod(BeanResolutionContext resolutionContext, DefaultBeanContext context, int methodIndex, java.lang.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, java.lang.Object bean)
resolutionContext
- The resolution contextcontext
- The bean contextindex
- The index of the fieldbean
- The bean being injected@Internal protected final java.lang.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 java.lang.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 java.util.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 javax.inject.Provider getBeanProviderForMethodArgument(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 java.util.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 java.util.stream.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 java.lang.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 java.lang.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 javax.inject.Provider getBeanProviderForConstructorArgument(BeanResolutionContext resolutionContext, BeanContext context, ConstructorInjectionPoint 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 java.util.Collection getBeansOfTypeForConstructorArgument(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 java.util.stream.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 java.util.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 java.lang.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 java.lang.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> java.util.Optional<T1> getValueForPath(BeanResolutionContext resolutionContext, BeanContext context, Argument<T1> propertyType, java.lang.String... propertyPath)
T1
- The generic typeresolutionContext
- The resolution contextcontext
- The bean contextpropertyType
- The required property typepropertyPath
- The property path@Internal protected final <T1> java.util.Optional<T1> getValueForPath(BeanResolutionContext resolutionContext, BeanContext context, Argument<T1> propertyType, java.lang.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, java.lang.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 java.lang.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 javax.inject.Provider getBeanProviderForField(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 java.util.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 java.util.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 java.util.stream.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 java.util.Map<java.lang.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