Package org.mvel

Examples of org.mvel.ExpressionCompiler.compile()


        if ( MVELDebugHandler.isDebugMode() ) {
            System.out.println( "Source before MVEL Compilation:\n" + text.trim() );
            compiler.setDebugSymbols( true );
        }

        Serializable expr = compiler.compile( parserContext );
        return expr;
    }

    public ParserContext getParserContext(final Dialect.AnalysisResult analysis,
                                          final Map outerDeclarations,
View Full Code Here


           
            parserContext.setStrictTypeEnforcement( false );

            parserContext.setInterceptors( dialect.getInterceptors() );

            compiler.compile( parserContext );

            result = analyze( compiler.getParserContextState().getInputs().keySet(),
                              availableIdentifiers );

            result.setMvelVariables( compiler.getParserContextState().getVariables() );
View Full Code Here

           
            parserContext.setStrictTypeEnforcement( false );

            parserContext.setInterceptors( dialect.getInterceptors() );

            compiler.compile( parserContext );

            result = analyze( compiler.getParserContextState().getInputs().keySet(),
                              availableIdentifiers );

            result.setMvelVariables( compiler.getParserContextState().getVariables() );
View Full Code Here

        if ( MVELDebugHandler.isDebugMode() ) {
            compiler.setDebugSymbols( true );
        }

        Serializable expr = compiler.compile( parserContext );
        return expr;
    }

    public ParserContext getParserContext(final Dialect.AnalysisResult analysis,
                                          final Map outerDeclarations,
View Full Code Here

    Object action = getActionNode().getAction();
    if (action instanceof DroolsConsequenceAction) {
      String actionString = ((DroolsConsequenceAction) action).getConsequence();
        ExpressionCompiler compiler = new ExpressionCompiler(actionString);
        ParserContext parserContext = new ParserContext();
        Serializable expression = compiler.compile(parserContext);
        DroolsMVELFactory factory = new DroolsMVELFactory(Collections.EMPTY_MAP, null, Collections.EMPTY_MAP);
        MVEL.executeExpression(expression, null, factory);
    } else {
      throw new RuntimeException("Unknown action: " + action);
    }
View Full Code Here

               ValueType.determineValueType( Object.class ) ); // value type
        this.extractors = new HashMap();
        this.variables = new HashMap();

        ExpressionCompiler compiler = new ExpressionCompiler( fieldName );
        this.mvelExpression = compiler.compile();
       
        Set inputs = compiler.getParserContextState().getInputs().keySet();
        for( Iterator it = inputs.iterator(); it.hasNext(); ) {
            String basefield = (String) it.next();
                       
View Full Code Here

       
        ExpressionCompiler compiler = new ExpressionCompiler( expression );
        ParserContext ctx = new ParserContext();
        ctx.addImport( "x", int.class );
       
        Serializable result = compiler.compile( ctx );
       
        try {
            byte[] out = serializeOut( result );
            Serializable in = (Serializable) serializeIn( out );
            assertNotNull( in );
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.