src/org/nutz/mapl/impl/MaplRebuild.java
@SuppressWarnings("unchecked")
    private Object inject(Object obj, int i) {
        String key = keys[i];
        // 根数组
        if (key.indexOf('[') == 0) {
            List<Object> list = new ArrayList<Object>();
            if (obj != null) {
                list = (List<Object>) obj;
            }
            injectList(list, i, fetchIndex(key));
            return list;
        }
        // 数组
        // if(key.endsWith("[]")){
        int pos = key.indexOf('[');
        if (pos > 0) {
            Map<String, Object> map = new LinkedHashMap<String, Object>();
            if (obj != null) {
                map = (Map<String, Object>) obj;
            }
            // 有Key的list
            String k = key.substring(0, pos);
            if (!map.containsKey(k)) {
                map.put(k, new ArrayList<Object>());
            }
            int[] index = fetchIndex(key.substring(key.indexOf('['), key.length()));
            injectList((List<Object>) map.get(k), i, index);
            return map;
        }
        // 键值：这里有个特殊考虑，如果当前对象是个列表，那么键值必然是一个下标
        if (obj instanceof List) {
            try {
                int index = Integer.parseInt(keys[i]);
                injectList((List<Object>) obj, i, Nums.array(index));
                return obj;
            }
            catch (Exception e) {
                throw new RuntimeException("路径格式不正确!");
            }
        }
        // 当做普通的 map 好了
        return injectMap(obj, i);
    }
@SuppressWarnings("unchecked")
    private Object inject(Object obj, int i) {
        String key = keys[i];
        // 根数组
        if (key.indexOf('[') == 0) {
            List<Object> list = new ArrayList<Object>();
            if (obj != null) {
                list = (List<Object>) obj;
            }
            injectList(list, i, fetchIndex(key));
            return list;
        }
        // 数组
        // if(key.endsWith("[]")){
        int pos = key.indexOf('[');
        if (pos > 0) {
            Map<String, Object> map = new LinkedHashMap<String, Object>();
            if (obj != null) {
                map = (Map<String, Object>) obj;
            }
            // 有Key的list
            String k = key.substring(0, pos);
            if (!map.containsKey(k)) {
                map.put(k, new ArrayList<Object>());
            }
            int[] index = fetchIndex(key.substring(key.indexOf('['), key.length()));
            injectList((List<Object>) map.get(k), i, index);
            return map;
        }
        // 键值：这里有个特殊考虑，如果当前对象是个列表，那么键值必然是一个下标
        if (obj instanceof List) {
            try {
                int index = Integer.parseInt(keys[i]);
                injectList((List<Object>) obj, i, Nums.array(index));
                return obj;
            }
            catch (Exception e) {
                throw new RuntimeException("路径格式不正确!");
            }
        }
        // 当做普通的 map 好了
        return injectMap(obj, i);
    }
@ SuppressWarnings ( "unchecked" ) private Object inject ( Object obj , int i ) { String key = keys [ i ] ; // 根数组 if ( key . indexOf ( ' ' ) == 0 ) { List < Object > list = new ArrayList < Object > ( ) ; if ( obj != null ) { list = ( List < Object > ) obj ; } injectList ( list , i , fetchIndex ( key ) ) ; return list ; } // 数组 // if(key.endsWith("[]")){ int pos = key . indexOf ( ' ' ) ; if ( pos > 0 ) { Map < String , Object > map = new LinkedHashMap < String , Object > ( ) ; if ( obj != null ) { map = ( Map < String , Object > ) obj ; } // 有Key的list String k = key . substring ( 0 , pos ) ; if ( ! map . containsKey ( k ) ) { map . put ( k , new ArrayList < Object > ( ) ) ; } int [ ] index = fetchIndex ( key . substring ( key . indexOf ( ' ' ) , key . length ( ) ) ) ; injectList ( ( List < Object > ) map . get ( k ) , i , index ) ; return map ; } // 键值：这里有个特殊考虑，如果当前对象是个列表，那么键值必然是一个下标 if ( obj instanceof List ) { try { int index = Integer . parseInt ( keys [ i ] ) ; injectList ( ( List < Object > ) obj , i , Nums . array ( index ) ) ; return obj ; } catch ( Exception e ) { throw new RuntimeException ( "路径格式不正确!"); } } // 当做普通的 map 好了 return injectMap ( obj , i ) ; }
注入

@param obj
@param i
注入