public String toGetSourceString()

in src/main/java/org/apache/commons/ognl/ASTSequence.java [99:157]


    public String toGetSourceString( OgnlContext context, Object target )
    {
        String result = "";

        NodeType lastType = null;

        for ( int i = 0; i < children.length; ++i )
        {
            // System.out.println("astsequence child : " + _children[i].getClass().getName());
            String seqValue = children[i].toGetSourceString( context, target );

            if ( ( i + 1 ) < children.length && children[i] instanceof ASTOr)
            {
                seqValue = "(" + seqValue + ")";
            }

            if ( i > 0 && children[i] instanceof ASTProperty && seqValue != null
                && !seqValue.trim().isEmpty() )
            {
                String pre = (String) context.get( "_currentChain" );
                if ( pre == null )
                {
                    pre = "";
                }

                seqValue =
                    ExpressionCompiler.getRootExpression( children[i], context.getRoot(), context ) + pre + seqValue;
                context.setCurrentAccessor( context.getRoot().getClass() );
            }

            if ( ( i + 1 ) >= children.length )
            {
                coreExpression = result;
                lastExpression = seqValue;
            }

            if ( seqValue != null && !seqValue.trim().isEmpty() && ( i + 1 ) < children.length )
            {
                result += seqValue + ";";
            }
            else if ( seqValue != null && !seqValue.trim().isEmpty() )
            {
                result += seqValue;
            }
            // set last known type from last child with a type

            if ( children[i] instanceof NodeType && ( (NodeType) children[i] ).getGetterClass() != null )
            {
                lastType = (NodeType) children[i];
            }
        }

        if ( lastType != null )
        {
            getterClass = lastType.getGetterClass();
        }

        return result;
    }