public class BeansUtils extends Object
Constructor and Description |
---|
BeansUtils() |
Modifier and Type | Method and Description |
---|---|
static <T> T |
getInstance(Class<T> clazz)
如果存在@Constr,使用Constr,否则尝试使用无参构造
|
static <T> T |
getInstance(Class<T> clazz,
DependCenter dependCenter)
如果存在@Constr,使用Constr,否则尝试使用无参构造,如果还是不行则尝试使用依赖获取
|
public static <T> T getInstance(Class<T> clazz) throws InvocationTargetException, IllegalAccessException, InstantiationException
clazz
- 类型InvocationTargetException
IllegalAccessException
InstantiationException
public static <T> T getInstance(Class<T> clazz, DependCenter dependCenter) throws InvocationTargetException, IllegalAccessException
clazz
- 类型dependCenter
- 依赖管理器InvocationTargetException
IllegalAccessException
Copyright © 2020. All rights reserved.