mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-05-09 23:51:34 +08:00
SpringUtil增加getBean重载(issue#3779@Github)
This commit is contained in:
parent
4437b63ee5
commit
a06b7a32aa
@ -2,13 +2,14 @@
|
|||||||
# 🚀Changelog
|
# 🚀Changelog
|
||||||
|
|
||||||
-------------------------------------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------------------------------------
|
||||||
# 5.8.34(2024-11-19)
|
# 5.8.34(2024-11-21)
|
||||||
|
|
||||||
### 🐣新特性
|
### 🐣新特性
|
||||||
* 【http 】 增加Windows微信浏览器识别(issue#IB3SJF@Gitee)
|
* 【http 】 增加Windows微信浏览器识别(issue#IB3SJF@Gitee)
|
||||||
* 【core 】 ZipUtil.unzip增加编码容错(issue#I3UZ28@Gitee)
|
* 【core 】 ZipUtil.unzip增加编码容错(issue#I3UZ28@Gitee)
|
||||||
* 【core 】 Calculator兼容`x`字符作为乘号(issue#3787@Github)
|
* 【core 】 Calculator兼容`x`字符作为乘号(issue#3787@Github)
|
||||||
* 【poi 】 Excel07SaxReader中,对于小数类型,增加精度判断(issue#IB0EJ9@Gitee)
|
* 【poi 】 Excel07SaxReader中,对于小数类型,增加精度判断(issue#IB0EJ9@Gitee)
|
||||||
|
* 【extra 】 SpringUtil增加getBean重载(issue#3779@Github)
|
||||||
|
|
||||||
### 🐞Bug修复
|
### 🐞Bug修复
|
||||||
* 【core 】 修复DateUtil.rangeToList中step小于等于0时无限循环问题(issue#3783@Github)
|
* 【core 】 修复DateUtil.rangeToList中step小于等于0时无限循环问题(issue#3783@Github)
|
||||||
|
@ -122,6 +122,19 @@ public class SpringUtil implements BeanFactoryPostProcessor, ApplicationContextA
|
|||||||
return getBeanFactory().getBean(clazz);
|
return getBeanFactory().getBean(clazz);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过class获取Bean
|
||||||
|
*
|
||||||
|
* @param <T> Bean类型
|
||||||
|
* @param clazz Bean类
|
||||||
|
* @param args 创建bean需要的参数属性
|
||||||
|
* @return Bean对象
|
||||||
|
* @since 5.8.34
|
||||||
|
*/
|
||||||
|
public static <T> T getBean(Class<T> clazz, Object... args) {
|
||||||
|
return getBeanFactory().getBean(clazz, args);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过name,以及Clazz返回指定的Bean
|
* 通过name,以及Clazz返回指定的Bean
|
||||||
*
|
*
|
||||||
@ -134,6 +147,18 @@ public class SpringUtil implements BeanFactoryPostProcessor, ApplicationContextA
|
|||||||
return getBeanFactory().getBean(name, clazz);
|
return getBeanFactory().getBean(name, clazz);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过name,以及Clazz返回指定的Bean
|
||||||
|
*
|
||||||
|
* @param name Bean名称
|
||||||
|
* @param args 创建bean需要的参数属性
|
||||||
|
* @return Bean对象
|
||||||
|
* @since 5.8.34
|
||||||
|
*/
|
||||||
|
public static Object getBean(String name, Object... args) {
|
||||||
|
return getBeanFactory().getBean(name, args);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过类型参考返回带泛型参数的Bean
|
* 通过类型参考返回带泛型参数的Bean
|
||||||
*
|
*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user