boon/src/main/java/org/boon/core/reflection/BeanUtils.java
private static Object getCollectionProp(Object o, String propName, int index, String[] path
                                           ) {
        o = _getFieldValuesFromCollectionOrArray(o, propName);

        if ( index + 1 == path.length ) {
            return o;
        } else {
            index++;
            return getCollectionProp(o, path[index], index, path);
        }
    }
private static Object getCollectionProp(Object o, String propName, int index, String[] path
                                           ) {
        o = _getFieldValuesFromCollectionOrArray(o, propName);

        if ( index + 1 == path.length ) {
            return o;
        } else {
            index++;
            return getCollectionProp(o, path[index], index, path);
        }
    }
private static Object getCollectionProp ( Object o , String propName , int index , String [ ] path ) { o = _getFieldValuesFromCollectionOrArray ( o , propName ) ; if ( index + 1 == path . length ) { return o ; } else { index ++ ; return getCollectionProp ( o , path [ index ] , index , path ) ; } }
This is an amazing little recursive method. It walks a fanout of
nested collection to pull out the leaf nodes
This is an amazing little recursive method . It walks a fanout of nested collection to pull out the leaf nodes