common_helper/src/main/java/com/xiongyingqi/util/EntityHelper.java
public static String[] getClassSimpleFields(Class<?> clazz) {
        Field[] fields = clazz.getDeclaredFields();
        int length = fields.length;
        Collection<Field> fieldCollection = new ArrayList<Field>();

        for (int i = 0; i < length; i++) {
            Field field = fields[i];
            if (isSimpleType(field)) {
                fieldCollection.add(field);
            }
        }
        String[] fieldNames = new String[fieldCollection.size()];
        int i = 0;
        for (Iterator iterator = fieldCollection.iterator(); iterator.hasNext(); ) {
            Field field = (Field) iterator.next();
            fieldNames[i] = field.getName();
            i++;
        }
        return fieldNames;
    }
public static String[] getClassSimpleFields(Class<?> clazz) {
        Field[] fields = clazz.getDeclaredFields();
        int length = fields.length;
        Collection<Field> fieldCollection = new ArrayList<Field>();

        for (int i = 0; i < length; i++) {
            Field field = fields[i];
            if (isSimpleType(field)) {
                fieldCollection.add(field);
            }
        }
        String[] fieldNames = new String[fieldCollection.size()];
        int i = 0;
        for (Iterator iterator = fieldCollection.iterator(); iterator.hasNext(); ) {
            Field field = (Field) iterator.next();
            fieldNames[i] = field.getName();
            i++;
        }
        return fieldNames;
    }
public static String [ ] getClassSimpleFields ( Class < ? > clazz ) { Field [ ] fields = clazz . getDeclaredFields ( ) ; int length = fields . length ; Collection < Field > fieldCollection = new ArrayList < Field > ( ) ; for ( int i = 0 ; i < length ; i ++ ) { Field field = fields [ i ] ; if ( isSimpleType ( field ) ) { fieldCollection . add ( field ) ; } } String [ ] fieldNames = new String [ fieldCollection . size ( ) ] ; int i = 0 ; for ( Iterator iterator = fieldCollection . iterator ( ) ; iterator . hasNext ( ) ; ) { Field field = ( Field ) iterator . next ( ) ; fieldNames [ i ] = field . getName ( ) ; i ++ ; } return fieldNames ; }
获取Class类的所有字段名 <br>
2013-10-21 下午5:19:48

@param clazz
@return
获取Class类的所有字段名 <br > 2013 - 10 - 21 下午5 : 19 : 48