springboot13 Hikari 和Introspector
2024-10-21 19:43:53
SpringBoot Initializr
Introspector(内省)
class TestReflect {
@Test
fun testReflect() {
//获取字节码对象
val clazz = Product::class.java
//创建实体对象
val product = clazz.newInstance()
//获取声明的字段
val fields = clazz.declaredFields
/* val writeMethodName = "set${it.name.substring(0, 1).toUpperCase()}${it.name.substring(1)}"
println(writeMethodName)
val writeMethod = clazz.getDeclaredMethod(writeMethodName, it.type)
writeMethod.invoke(product,13)*/
//通过Introspector获取javaBean信息
val beanInfo = Introspector.getBeanInfo(clazz)
//通过beanInfo获取到所有的属性描述,遍历获取它们的set方法
beanInfo.propertyDescriptors.forEach {
println(it.writeMethod)
}
}
Hikari
file and code templates
Setting-----Editor-----Class
常用资讯网站
csdn,简书,小红书,掘金,stackoverflow,androidWeekly,https://segmentfault.com/
最新文章
- 2次使用fork避免产生僵尸进程和不去处理SIGCHLD信号
- Coursera-Getting and Cleaning Data-Week2-课程笔记
- Opensource开源精神
- 自定义select控件开发
- CoreException: Could not calculate build plan: Plugin org.apache.maven.plugins:maven-compiler-plugin:3.1 or one of its dependencies could not be resolved
- iOS-appDelegate 生命周期
- Unity加入Android广告小结
- Graphviz-Gdot语言学习
- vim配置(vimplus)
- [Unity AssetBundle]Asset资源处理
- 【前端】一步一步使用webpack+react+scss脚手架重构项目
- Android学习笔记-TextView(文本框)(二)
- ubuntu 常用命令集
- BitCoin p2p通信过程
- 错误	103	未能加载文件或程序集“Telerik.Web.UI”或它的某一个依赖项。磁盘空间不足。 (异常来自 HRESULT:0x80070070)
- 关键字(7):属性的增删改add,drop,modify
- abap test msg
- spring quartz执行两次问题
- P2-Centos中安装vsftpd
- 使用SQL语句如何实现条件判断