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> |
fieldInjectionPoints |
protected List<MethodInjectionPoint> |
methodInjectionPoints |
protected List<MethodInjectionPoint> |
postConstructMethods |
protected List<MethodInjectionPoint> |
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 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 Provider |
getBeanProviderForConstructorArgument(BeanResolutionContext resolutionContext,
BeanContext context,
ConstructorInjectionPoint constructorInjectionPoint,
Argument argument)
Obtains a bean provider for a constructor at the given index
|
protected 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 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 Collection |
getBeansOfTypeForConstructorArgument(BeanResolutionContext resolutionContext,
BeanContext context,
ConstructorInjectionPoint<T> constructorInjectionPoint,
Argument argument)
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 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<Class<?>> |
getDeclaringType() |
Collection<ExecutableMethod<T,?>> |
getExecutableMethods() |
Collection<FieldInjectionPoint> |
getInjectedFields()
All the fields that require injection.
|
Collection<MethodInjectionPoint> |
getInjectedMethods()
All methods that require injection.
|
String |
getName() |
Collection<MethodInjectionPoint> |
getPostConstructMethods()
All the methods that should be called once the bean has been fully initialized and constructed.
|
Collection<MethodInjectionPoint> |
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() |
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.
|
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 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)
Return whether this component is enabled for the given context.
|
boolean |
isIterable() |
boolean |
isPrimary() |
boolean |
isProvided() |
boolean |
isSingleton() |
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
getRequiredMethod, getTypeArguments, getTypeArguments, getTypeParameters, getTypeParameters, isProxy
booleanValue, booleanValue, booleanValue, booleanValue, classValue, classValue, classValue, classValue, classValues, classValues, classValues, classValues, doubleValue, doubleValue, doubleValue, enumValue, enumValue, enumValue, enumValue, 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, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValues, getValues, hasAnnotation, hasAnnotation, hasDeclaredAnnotation, hasDeclaredAnnotation, hasDeclaredStereotype, hasDeclaredStereotype, hasDeclaredStereotype, 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
protected final List<MethodInjectionPoint> methodInjectionPoints
protected final List<FieldInjectionPoint> fieldInjectionPoints
protected final List<MethodInjectionPoint> postConstructMethods
protected final List<MethodInjectionPoint> preDestroyMethods
protected final Map<io.micronaut.context.AbstractBeanDefinition.MethodKey,ExecutableMethod<T,?>> executableMethodMap
@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 bean@Nonnull public List<Argument<?>> getTypeArguments(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> 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>
public boolean isSingleton()
isSingleton
in interface BeanDefinition<T>
public Optional<Class<? extends Annotation>> getScope()
getScope
in interface BeanDefinition<T>
public Class<T> getBeanType()
BeanType
getBeanType
in interface BeanDefinition<T>
getBeanType
in interface BeanType<T>
public Optional<Class<?>> getDeclaringType()
getDeclaringType
in interface BeanDefinition<T>
public ConstructorInjectionPoint<T> getConstructor()
BeanDefinition
getConstructor
in interface BeanDefinition<T>
public Collection<Class> getRequiredComponents()
getRequiredComponents
in interface BeanDefinition<T>
public Collection<MethodInjectionPoint> getInjectedMethods()
BeanDefinition
getInjectedMethods
in interface BeanDefinition<T>
public Collection<FieldInjectionPoint> getInjectedFields()
BeanDefinition
getInjectedFields
in interface BeanDefinition<T>
public Collection<MethodInjectionPoint> getPostConstructMethods()
BeanDefinition
getPostConstructMethods
in interface BeanDefinition<T>
public Collection<MethodInjectionPoint> getPreDestroyMethods()
BeanDefinition
getPreDestroyMethods
in interface BeanDefinition<T>
public 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 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 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 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 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 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 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 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 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 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(BeanContext context)
BeanContextConditional
isEnabled
in interface BeanContextConditional
context
- The context