protected HashMap getFieldMap(Class cl)
    {
        HashMap fieldMap = new HashMap();

        for (; cl != null; cl = cl.getSuperclass()) {
            Field[] fields = cl.getDeclaredFields();
            for (int i = 0; i < fields.length; i++) {
                Field field = fields[i];

                if (Modifier.isTransient(field.getModifiers()) ||
                    Modifier.isStatic(field.getModifiers()))
                    continue;

                // XXX: could parameterize the handler to only deal with public
                field.setAccessible(true);

                fieldMap.put(field.getName(), field);
            }
        }

        return fieldMap;
    }
protected HashMap getFieldMap ( Class cl ) { HashMap fieldMap = new HashMap ( ) ; for ( ; cl != null ; cl = cl . getSuperclass ( ) ) { Field [ ] fields = cl . getDeclaredFields ( ) ; for ( int i = 0 ; i < fields . length ; i ++ ) { Field field = fields [ i ] ; if ( Modifier . isTransient ( field . getModifiers ( ) ) || Modifier . isStatic ( field . getModifiers ( ) ) ) continue ; field . setAccessible ( true ) ; fieldMap . put ( field . getName ( ) , field ) ; } } return fieldMap ; }
Creates a map of the classes fields.