通过java反射获得属性名 和 值


网上查的, 稍微改了改

有空再好好改

public static void getAllFieldsName(Object model) throws NoSuchMethodException, IllegalAccessException, IllegalArgumentException, InvocationTargetException
	{
    	Field[] field = model.getClass().getDeclaredFields();//获取实体类的所有属性,返回Field数组  
        for(int j=0 , len=field.length; j


你可能感兴趣的:(Java入门)