InstanceSupplier that provides the factory Method
used to instantiate the underlying bean instance, if any. Transparently
handles resolution of AutowiredArguments if necessary. Typically used
in AOT-processed applications as a targeted alternative to the reflection
based injection.
If no generator is provided, reflection is used to instantiate the
bean instance, and full invocation hints are
contributed. Multiple generator callback styles are supported:
registeredBean and resolved arguments
for executables that require arguments resolution. An
introspection hint is added so that
parameter annotations can be read registeredBean for simpler cases that
do not require resolution of argumentsAutowiredArguments
| Modifier and Type | Class and Description |
|---|---|
| private static class | BeanInstanceSupplier.ConstructorLookup
Performs lookup of the |
| pack-priv abstract static class | BeanInstanceSupplier.ExecutableLookup
Performs lookup of the |
| private static class | BeanInstanceSupplier.FactoryMethodLookup
Performs lookup of the factory |
| Modifier and Type | Field and Description |
|---|---|
| private final ThrowingBiFunction | |
| private final BeanInstanceSupplier. | |
| private final String[] |
| Access | Constructor and Description |
|---|---|
| private | BeanInstanceSupplier(BeanInstanceSupplier.
|
| Modifier and Type | Method and Description |
|---|---|
| private Object | |
| public static < the type of instance supplied T> BeanInstanceSupplier | Returns: a newBeanInstanceSupplier instancethe constructor parameter types parameterTypes)Create a |
| public static < the type of instance supplied T> BeanInstanceSupplier | Returns: a newBeanInstanceSupplier instancethe class that declares the factory method declaringClass, String the factory method name methodName, Class<?>... the factory method parameter types parameterTypes)Create a new |
| public T | get(RegisteredBean
the registered bean requesting the instance registeredBean)Implements org. |
| public Method | getFactoryMethod()
Overrides default org. null if it is not known or this supplier uses
another means.
|
| private Object | |
| pack-priv BeanInstanceSupplier. | |
| private MethodParameter | |
| private T | |
| private Object | |
| private Object | |
| private T | |
| pack-priv AutowiredArguments | Returns: the resolved constructor or factory method argumentsthe registered bean registeredBean)Resolve arguments for the specified registered bean. |
| private AutowiredArguments | |
| private ConstructorArgumentValues. | resolveArgumentValue(BeanDefinitionValueResolver resolver, ConstructorArgumentValues.
|
| private ConstructorArgumentValues. | |
| private Object | resolveAutowiredArgument(RegisteredBean registeredBean, DependencyDescriptor descriptor, ConstructorArgumentValues.
|
| private ConstructorArgumentValues | resolveConstructorArguments(BeanDefinitionValueResolver valueResolver, ConstructorArgumentValues constructorArguments)
|
| private static String | |
| public BeanInstanceSupplier | Returns: a newBeanInstanceSupplier instance with the specified generatora generator)ThrowingBiFunction that uses the
RegisteredBean and resolved AutowiredArguments to
instantiate the underlying beanReturn a new |
| public BeanInstanceSupplier | Returns: a newBeanInstanceSupplier instance with the specified generatora generator)ThrowingFunction that uses the
RegisteredBean to instantiate the underlying beanReturn a new |
| public BeanInstanceSupplier | Returns: a newBeanInstanceSupplier instance with the specified generatora generator)ThrowingSupplier to instantiate the underlying bean
Deprecated
for removal since 6.0.11. in favor of
Return a new withGenerator(ThrowingFunction)
BeanInstanceSupplier instance that uses the specified
generator supplier to instantiate the underlying bean.
|
| public BeanInstanceSupplier | Returns: a newBeanInstanceSupplier instance
that uses the shortcutsthe bean names to use as shortcuts (aligned with the
constructor or factory method parameters) beanNames)Return a new |
| generator | back to summary |
|---|---|
| private final ThrowingBiFunction<RegisteredBean, AutowiredArguments, T> generator
| |
| lookup | back to summary |
|---|---|
| private final BeanInstanceSupplier. | |
| shortcuts | back to summary |
|---|---|
| private final String[] shortcuts
| |
| BeanInstanceSupplier | back to summary |
|---|---|
| private BeanInstanceSupplier(BeanInstanceSupplier. | |
| createInstance | back to summary |
|---|---|
| private Object createInstance(Class<?> clazz) throws Exception | |
| forConstructor | back to summary |
|---|---|
| public static <T> BeanInstanceSupplier Create a
| |
| forFactoryMethod | back to summary |
|---|---|
| public static <T> BeanInstanceSupplier Create a new
| |
| get | back to summary |
|---|---|
| public T get(RegisteredBean registeredBean) throws Exception Implements org. Doc from org. Get the supplied instance.
| |
| getFactoryMethod | back to summary |
|---|---|
| public Method getFactoryMethod() Overrides default org. Doc from org. Return the factory method that this supplier uses to create the
instance, or | |
| getFactoryMethodTarget | back to summary |
|---|---|
private Object getFactoryMethodTarget(BeanFactory beanFactory, Method method)
| |
| getLookup | back to summary |
|---|---|
| pack-priv BeanInstanceSupplier. | |
| getMethodParameter | back to summary |
|---|---|
| private MethodParameter getMethodParameter(Executable executable, int index) | |
| instantiate | back to summary |
|---|---|
private T instantiate(ConfigurableBeanFactory beanFactory, Executable executable, Object[] args)
| |
| instantiate | back to summary |
|---|---|
| private Object instantiate(Constructor<?> constructor, Object[] args) throws Exception | |
| instantiate | back to summary |
|---|---|
| private Object instantiate(ConfigurableBeanFactory beanFactory, Method method, Object[] args) throws Exception | |
| invokeBeanSupplier | back to summary |
|---|---|
| private T invokeBeanSupplier(Executable executable, ThrowingSupplier<T> beanSupplier) | |
| resolveArguments | back to summary |
|---|---|
| pack-priv AutowiredArguments resolveArguments(RegisteredBean registeredBean) Resolve arguments for the specified registered bean.
| |
| resolveArguments | back to summary |
|---|---|
| private AutowiredArguments resolveArguments(RegisteredBean registeredBean, Executable executable) | |
| resolveArgumentValue | back to summary |
|---|---|
| private ConstructorArgumentValues. | |
| resolveArgumentValues | back to summary |
|---|---|
| private ConstructorArgumentValues. | |
| resolveAutowiredArgument | back to summary |
|---|---|
private Object resolveAutowiredArgument(RegisteredBean registeredBean, DependencyDescriptor descriptor, ConstructorArgumentValues.
| |
| resolveConstructorArguments | back to summary |
|---|---|
| private ConstructorArgumentValues resolveConstructorArguments(BeanDefinitionValueResolver valueResolver, ConstructorArgumentValues constructorArguments) | |
| toCommaSeparatedNames | back to summary |
|---|---|
| private static String toCommaSeparatedNames(Class<?>... parameterTypes) | |
| withGenerator | back to summary |
|---|---|
| public BeanInstanceSupplier Return a new
| |
| withGenerator | back to summary |
|---|---|
| public BeanInstanceSupplier Return a new
| |
| withGenerator | back to summary |
|---|---|
| public BeanInstanceSupplier Return a new
| |
| withShortcuts | back to summary |
|---|---|
| public BeanInstanceSupplier Return a new
| |
Constructor.
| Modifier and Type | Field and Description |
|---|---|
| private final Class |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public Executable | get(RegisteredBean registeredBean)
Implements abstract org. |
| public String |
| parameterTypes | back to summary |
|---|---|
| private final Class<?>[] parameterTypes | |
| ConstructorLookup | back to summary |
|---|---|
| pack-priv ConstructorLookup(Class<?>[] parameterTypes) | |
| get | back to summary |
|---|---|
| public Executable get(RegisteredBean registeredBean) Implements abstract org.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object. | |
Executable.
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv abstract Executable |
| ExecutableLookup | back to summary |
|---|---|
| pack-priv ExecutableLookup() | |
| get | back to summary |
|---|---|
| pack-priv abstract Executable get(RegisteredBean registeredBean) | |
Method.
| Modifier and Type | Field and Description |
|---|---|
| private final Class | |
| private final String | |
| private final Class |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public Executable | get(RegisteredBean registeredBean)
Implements abstract org. |
| pack-priv Method | |
| public String |
| declaringClass | back to summary |
|---|---|
| private final Class<?> declaringClass | |
| methodName | back to summary |
|---|---|
| private final String methodName | |
| parameterTypes | back to summary |
|---|---|
| private final Class<?>[] parameterTypes | |
| FactoryMethodLookup | back to summary |
|---|---|
| pack-priv FactoryMethodLookup(Class<?> declaringClass, String methodName, Class<?>[] parameterTypes) | |
| get | back to summary |
|---|---|
| public Executable get(RegisteredBean registeredBean) Implements abstract org.
| |
| get | back to summary |
|---|---|
| pack-priv Method get() | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object. | |