src/org/nutz/castor/Castors.java
private void fillMap(Class<?> klass, HashMap<Class<?>, Method> settingMap, boolean replace)
            throws InstantiationException, IllegalAccessException, IllegalArgumentException,
            InvocationTargetException {
        Castor<?, ?> castor = (Castor<?, ?>) klass.newInstance();
        String key = castor.toString();
        if (!map.containsKey(key) || replace) {
            map.put(key, castor);
        } else {
            castor = map.get(key);
        }
        Method m = settingMap.get(castor.getClass());
        if (null == m) {
            for (Entry<Class<?>, Method> entry : settingMap.entrySet()) {
                Class<?> cc = entry.getKey();
                if (cc.isAssignableFrom(klass)) {
                    m = settingMap.get(cc);
                    break;
                }
            }
        }
        if (null != m)
            m.invoke(setting, castor);
    }
private void fillMap(Class<?> klass, HashMap<Class<?>, Method> settingMap, boolean replace)
            throws InstantiationException, IllegalAccessException, IllegalArgumentException,
            InvocationTargetException {
        Castor<?, ?> castor = (Castor<?, ?>) klass.newInstance();
        String key = castor.toString();
        if (!map.containsKey(key) || replace) {
            map.put(key, castor);
        } else {
            castor = map.get(key);
        }
        Method m = settingMap.get(castor.getClass());
        if (null == m) {
            for (Entry<Class<?>, Method> entry : settingMap.entrySet()) {
                Class<?> cc = entry.getKey();
                if (cc.isAssignableFrom(klass)) {
                    m = settingMap.get(cc);
                    break;
                }
            }
        }
        if (null != m)
            m.invoke(setting, castor);
    }
填充 map .<br>
在map中使用hash值来做为key来进行存储

@param klass
@param settingMap
@param replace
@throws InstantiationException
@throws IllegalAccessException
@throws IllegalArgumentException
@throws InvocationTargetException