public class DefaultSpringContainerAccessor extends Object implements ContainerAccessor
| Modifier and Type | Class and Description |
|---|---|
static class |
DefaultSpringContainerAccessor.AutowireStrategy
The autowire strategy to use when creating and wiring a bean
|
| Constructor and Description |
|---|
DefaultSpringContainerAccessor(Object applicationContext) |
| Modifier and Type | Method and Description |
|---|---|
<T> T |
createBean(Class<T> clazz)
Will ask the container to instantiate a bean of the given class and does inject all constructor defined dependencies.
|
<T> T |
getBean(String id)
Retrieves a bean by name from the container.
|
<T> Collection<T> |
getBeansOfType(Class<T> interfaceClass)
Gets all the beans that implement a given interface
|
<T> T |
injectBean(T bean)
Injects an existing bean instance with any dependencies via setters or private field injection
|
public DefaultSpringContainerAccessor(Object applicationContext)
public <T> T createBean(Class<T> clazz)
ContainerAccessorcreateBean in interface ContainerAccessorclazz - the Class to instantiate. Cannot be null.public <T> T injectBean(T bean)
ContainerAccessorinjectBean in interface ContainerAccessorT - The bean typebean - The instantiated bean to injectpublic <T> Collection<T> getBeansOfType(Class<T> interfaceClass)
ContainerAccessorgetBeansOfType in interface ContainerAccessorT - The target interface typeinterfaceClass - The interface classpublic <T> T getBean(String id)
ContainerAccessorgetBean in interface ContainerAccessorid - the id of the container bean, cannot be nullCopyright © 2019 Atlassian. All rights reserved.