public static String[] findAllInClassFieldsName(Class l) {
String[] fieldStr = null;
if (l != null) {
Field[] fields = l.getDeclaredFields();
fieldStr = new String[fields.length];
for (int i = 0; i < fields.length; i++) {
fieldStr[i] = fields[i].getName();
}
}
return fieldStr;
}
转载于:https://www.cnblogs.com/zzl0916/p/11142637.html