src/org/nutz/el/parse/Converter.java
private Object parseItem(Object item) {
        // 处理参数个数
        if (methods.peek() != null) {
            MethodOpt opt = methods.peek();
            if (opt.getSize() <= 0) {
                if (!(item instanceof CommaOpt) && !(item instanceof RBracketOpt)) {
                    opt.setSize(1);
                }
            } else {
                if (item instanceof CommaOpt) {
                    opt.setSize(opt.getSize() + 1);
                }
            }
        }

        // 左括号
        if (item instanceof LBracketOpt) {
            if (prev instanceof Elobj) {
                MethodOpt prem = new MethodOpt();
                item = new Object[]{prem, new LBracketOpt()};
                methods.addFirst(prem);
            } else {
                methods.addFirst(null);
            }
        }

        // 右括号
        if (item instanceof RBracketOpt) {
            if (methods.poll() != null) {
                item = new Object[]{new RBracketOpt(), new InvokeMethodOpt()};
            }
        }
        // 转换负号'-'
        if (item instanceof SubOpt && NegativeOpt.isNegetive(prev)) {
            item = new NegativeOpt();
        }
        prev = item;
        return item;
    }
private Object parseItem(Object item) {
        // 处理参数个数
        if (methods.peek() != null) {
            MethodOpt opt = methods.peek();
            if (opt.getSize() <= 0) {
                if (!(item instanceof CommaOpt) && !(item instanceof RBracketOpt)) {
                    opt.setSize(1);
                }
            } else {
                if (item instanceof CommaOpt) {
                    opt.setSize(opt.getSize() + 1);
                }
            }
        }

        // 左括号
        if (item instanceof LBracketOpt) {
            if (prev instanceof Elobj) {
                MethodOpt prem = new MethodOpt();
                item = new Object[]{prem, new LBracketOpt()};
                methods.addFirst(prem);
            } else {
                methods.addFirst(null);
            }
        }

        // 右括号
        if (item instanceof RBracketOpt) {
            if (methods.poll() != null) {
                item = new Object[]{new RBracketOpt(), new InvokeMethodOpt()};
            }
        }
        // 转换负号'-'
        if (item instanceof SubOpt && NegativeOpt.isNegetive(prev)) {
            item = new NegativeOpt();
        }
        prev = item;
        return item;
    }
private Object parseItem ( Object item ) { // 处理参数个数 if ( methods . peek ( ) != null ) { MethodOpt opt = methods . peek ( ) ; if ( opt . getSize ( ) <= 0 ) { if ( ! ( item instanceof CommaOpt ) && ! ( item instanceof RBracketOpt ) ) { opt . setSize ( 1 ) ; } } else { if ( item instanceof CommaOpt ) { opt . setSize ( opt . getSize ( ) + 1 ) ; } } } // 左括号 if ( item instanceof LBracketOpt ) { if ( prev instanceof Elobj ) { MethodOpt prem = new MethodOpt ( ) ; item = new Object [ ] { prem , new LBracketOpt ( ) } ; methods . addFirst ( prem ) ; } else { methods . addFirst ( null ) ; } } // 右括号 if ( item instanceof RBracketOpt ) { if ( methods . poll ( ) != null ) { item = new Object [ ] { new RBracketOpt ( ) , new InvokeMethodOpt ( ) } ; } } // 转换负号'-' if ( item instanceof SubOpt && NegativeOpt . isNegetive ( prev ) ) { item = new NegativeOpt ( ) ; } prev = item ; return item ; }
转换数据,主要是转换负号,方法执行
转换数据 主要是转换负号 方法执行