This topic created in 1987 days ago, the information mentioned may be changed or developed.
比如根据"id"获取 Test::getId
主要是想根据字段名获取字段值
目前我知道的方式有
1 、反射 field/getter method
2 、PropertyDescriptor readMethod
3 、reflectASM methodAccess
能不能通过字段名获取 getter function,这样类似调用原始 getter 方法,效率会比较快一点
或者还有没有别的方式来根据字段名获取字段值的?
3 replies 2020-11-25 09:26:11 +08:00  | | 1 boris93 Nov 23, 2020 via Android 字段名首字母变大写,然后前面拼接“get”,得到 getXxxx 这个 getter 方法名 然后反射去 invoke 这个名字的方法 |