public class DependencyInjection
extends java.lang.Object
Constructor and Description |
---|
DependencyInjection(BeanUtils beanUtils,
ComponentScanner componentScanner) |
Modifier and Type | Method and Description |
---|---|
BeanUtils |
beanUtils() |
<T> T |
getBean(java.lang.Class<T> clazz) |
<T> void |
presetPrototype(java.lang.Class<T> clazz)
Manually set a prototype before calling
scan(String...) |
<T> void |
presetSingleton(java.lang.Class<T> clazz)
Manually set a singleton before calling
scan(String...) |
<T> void |
presetSingleton(T ref,
java.lang.Class<T> clazz)
Manually set a singleton before calling
scan(String...) |
void |
scan(java.lang.String... packageNames)
|
void |
shutdown() |
public DependencyInjection(BeanUtils beanUtils, ComponentScanner componentScanner)
public <T> void presetSingleton(T ref, java.lang.Class<T> clazz)
scan(String...)
ref
- The singleton objectclazz
- The Class
of the singletonpublic <T> void presetSingleton(java.lang.Class<T> clazz) throws java.lang.Exception
scan(String...)
clazz
- The Class
of the singletonjava.lang.Exception
- Thrown if the object could not be instantiatedpublic <T> void presetPrototype(java.lang.Class<T> clazz) throws java.lang.Exception
scan(String...)
clazz
- The Class
of the prototypejava.lang.Exception
- Thrown if the object could not be instantiatedpublic void scan(java.lang.String... packageNames) throws java.lang.Exception
Singleton
and
Prototype
instances and processes all Autowired
annotationspackageNames
- The names of packages to scanjava.lang.Exception
- Thrown if a class could not be instantiated or if autowired
could not be completedpublic void shutdown()
public <T> T getBean(java.lang.Class<T> clazz)
public BeanUtils beanUtils()