我想提取未由某些自定义注释标记的私有字段值,这可以通过 BeanUtils 实现吗?如果是,怎么办?
是的,假设您知道字段名称。您可以使用PropertyUtils.getSimpleProperty(...) http://commons.apache.org/beanutils/apidocs/org/apache/commons/beanutils/PropertyUtils.html#getSimpleProperty%28java.lang.Object,%20java.lang.String%29。也可以看看here http://commons.apache.org/beanutils/apidocs/org/apache/commons/beanutils/package-summary.html#standard.basic举个例子。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)