Package org.mvel2.compiler

Examples of org.mvel2.compiler.ExpressionCompiler.compile()


            // create MVEL compilation
            final ParserContext parserContext = new ParserContext();
            parserContext.setStrictTypeEnforcement( false );

            ExpressionCompiler compiler = new ExpressionCompiler( this.text );
            this.expr = compiler.compile( parserContext );
        }

        XLSReadStatus readStatus = null;
        Map<String, Object> beans = null;
        try {
View Full Code Here


    public MvelAction(String text) {
        final ParserContext parserContext = new ParserContext();
        parserContext.setStrictTypeEnforcement( false );

        ExpressionCompiler compiler = new ExpressionCompiler( text );
        this.expr = compiler.compile( );
    }

    public void receive(Object object,
                        PipelineContext context) {
        try {
View Full Code Here

    public MvelExpression(String text) {
        final ParserContext parserContext = new ParserContext();
        parserContext.setStrictTypeEnforcement( false );

        ExpressionCompiler compiler = new ExpressionCompiler( text );
        this.expr = compiler.compile( parserContext );
    }

    public void receive(Object object,
                       PipelineContext context) {
        Object result = null;
View Full Code Here

        MvelContext mCon = new MvelContext();
        mCon.setInitialContext( initialContext );

        try {
            ExpressionCompiler compiler = new ExpressionCompiler( macroMvel );
            CompiledExpression expression = compiler.compile( initialContext );
            mCon.setExpression( expression );

            ParserContext compilationContext = compiler.getParserContextState();

            Class lastType = expression.getKnownEgressType();
View Full Code Here

            ClassLoader tempClassLoader = Thread.currentThread().getContextClassLoader();

            Thread.currentThread().setContextClassLoader( classLoader );

            AbstractParser.setLanguageLevel( languageLevel );
            Serializable expr = compiler.compile( parserContext );

            Thread.currentThread().setContextClassLoader( tempClassLoader );

            return expr;
        }
View Full Code Here

               Object.class, // fieldType
               ValueType.determineValueType( Object.class ) ); // value type
        this.extractors = 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

            ClassLoader tempClassLoader = Thread.currentThread().getContextClassLoader();

            Thread.currentThread().setContextClassLoader( pkgBuilder.getRootClassLoader() );

            AbstractParser.setLanguageLevel( languageLevel );
            Serializable expr = compiler.compile( parserContext );

            Thread.currentThread().setContextClassLoader( tempClassLoader );

            return expr;
        }
View Full Code Here

        context.setStrictTypeEnforcement( true );
        //context.setDebugSymbols( true );
        context.setSourceFile( "mysource" );


        Serializable compiledExpression = compiler.compile( context );

        String s = DebugTools.decompile( compiledExpression );

        System.out.println( "s " + s );
View Full Code Here

        context.setStrictTypeEnforcement( true );
        //context.setDebugSymbols( true );
        context.setSourceFile( "mysource" );


        Serializable compiledExpression = compiler.compile( context );

        String s = DebugTools.decompile( compiledExpression );

        System.out.println( "s " + s );
View Full Code Here

            Serializable template = this.templateCache.get(expression);
            if (template == null) {
                LOG.debug("Compiled template not found in cache, compiling template and caching.");
                ExpressionCompiler compiler = new ExpressionCompiler(expression);
                compiler.newContext(context);
                template = compiler.compile();
                this.templateCache.put(expression, template);
            }
            return MVEL.executeExpression(template, root, evaluationContext);
        } catch (Exception e) {
            throw new ExpressionEvaluationException(expression, e);
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.