- PropertyUtils.getSimpleProperty 用法
import org.apache.commons.beanutils.PropertyUtils;
public static void main(String[] args) {
String prop = "fA";
SjjDemoVO t = new SjjDemoVO();
t.setfA("aaa");
String val = "";
try {
val = PropertyUtils.getSimpleProperty(t, prop).toString();
} catch (IllegalAccessException | InvocationTargetException
| NoSuchMethodException e) {
e.printStackTrace();
}
System.out.println("val="+val);
//console: val=aaa
}