Java Code Examples for org.apache.commons.beanutils.PropertyUtils#MAPPED_DELIM2

The following examples show how to use org.apache.commons.beanutils.PropertyUtils#MAPPED_DELIM2 . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: PojoPropertyUtilsBean.java    From rice with Educational Community License v2.0 5 votes vote down vote up
private int findNextNestedIndex(String expression)
{
    // walk back from the end to the start
    // and find the first index that
    int bracketCount = 0;
    for (int i=0, size=expression.length(); i<size ; i++) {
        char at = expression.charAt(i);
        switch (at) {
            case PropertyUtils.NESTED_DELIM:
                if (bracketCount < 1) {
                    return i;
                }
                break;

            case PropertyUtils.MAPPED_DELIM:
            case PropertyUtils.INDEXED_DELIM:
                // not bothered which
                ++bracketCount;
                break;

            case PropertyUtils.MAPPED_DELIM2:
            case PropertyUtils.INDEXED_DELIM2:
                // not bothered which
                --bracketCount;
                break;
        }
    }
    // can't find any
    return -1;
}