Examples of ParserConfiguration


Examples of org.mvel2.ParserConfiguration

       
        readLocalsFromTuple = in.readBoolean();
    }   

    public Serializable getCompiledExpression(MVELDialectRuntimeData runtimeData ) {       
        ParserConfiguration conf = runtimeData.getParserConfiguration();
        final ParserContext parserContext = new ParserContext( conf );
        if ( MVELDebugHandler.isDebugMode() ) {
            parserContext.setDebugSymbols( true );
        }
View Full Code Here

Examples of org.mvel2.ParserConfiguration

            } catch ( ClassNotFoundException e ) {
                throw new IllegalArgumentException( "Unable to resolve method of field: " + key + " - " + value, e );

            }

            this.parserConfiguration = new ParserConfiguration();
            this.parserConfiguration.setImports( this.imports );
            this.parserConfiguration.setPackageImports( this.packageImports );
            this.parserConfiguration.setClassLoader( packageClassLoader );
        }
        return this.parserConfiguration;
View Full Code Here

Examples of org.mvel2.ParserConfiguration

    protected void createMvelConditionEvaluator(InternalWorkingMemory workingMemory) {
        if (compilationUnit != null) {
            MVELDialectRuntimeData data = getMVELDialectRuntimeData(workingMemory);
            ExecutableStatement statement = (ExecutableStatement)compilationUnit.getCompiledExpression(data);
            ParserConfiguration configuration = statement instanceof CompiledExpression ?
                    ((CompiledExpression)statement).getParserConfiguration() :
                    data.getParserConfiguration();
            conditionEvaluator = new MvelConditionEvaluator(compilationUnit, configuration, statement, declarations, getAccessedClass());
        } else {
            conditionEvaluator = new MvelConditionEvaluator(getParserConfiguration(workingMemory), expression, declarations, getAccessedClass());
View Full Code Here

Examples of org.mvel2.ParserConfiguration

       
        readLocalsFromTuple = in.readBoolean();
    }   

    public Serializable getCompiledExpression(MVELDialectRuntimeData runtimeData ) {       
        ParserConfiguration conf = runtimeData.getParserConfiguration();
        final ParserContext parserContext = new ParserContext( conf );
        if ( MVELDebugHandler.isDebugMode() ) {
            parserContext.setDebugSymbols( true );
        }
View Full Code Here

Examples of org.mvel2.ParserConfiguration

                context.put( "Handles",
                             handles );
            }

            NodeTestCase testCase = (NodeTestCase) context.get( "TestCase" );
            ParserConfiguration conf = new ParserConfiguration();
            for( String imp : testCase.getImports() ) {
                if( imp.endsWith( ".*" ) ) {
                    conf.addPackageImport( imp.substring( 0, imp.lastIndexOf( '.' ) ) );
                } else {
                    try {
                        conf.addImport( imp.substring( imp.lastIndexOf( "." )+1 ), reteTesterHelper.getTypeResolver().resolveType( imp ) );
                    } catch ( ClassNotFoundException e ) {
                        throw new IllegalArgumentException( "Unable to resolve import: "+imp);
                    }
                }
            }
View Full Code Here

Examples of org.mvel2.ParserConfiguration

                                   vars );
        // add all context variables, just in case
        vars.putAll( context );

        // add the static imports for hamcrest matchers
        ParserConfiguration pconf = new ParserConfiguration();
        addStaticImports( pconf,
                          CoreMatchers.class );
        addStaticImports( pconf,
                          JUnitMatchers.class );
        try {
            pconf.addImport( "isTuple", IsTuple.class.getMethod( "isTuple", List.class ) );
        } catch ( Exception e1 ) {
            e1.printStackTrace();
        }
        // add import for JUnit assert class
        pconf.addImport( "Assert",
                         Assert.class );

        // compile MVEL expression
        ParserContext mvelctx = new ParserContext( pconf );
        String expression;
View Full Code Here

Examples of org.mvel2.ParserConfiguration

                                   vars );
        // add all context variables, just in case
        vars.putAll( context );

        // add the static imports for hamcrest matchers
        ParserConfiguration pconf = new ParserConfiguration();
        addStaticImports( pconf,
                          CoreMatchers.class );
        addStaticImports( pconf,
                          JUnitMatchers.class );
        try {
            pconf.addImport( "isTuple", IsTuple.class.getMethod( "isTuple", List.class ) );
        } catch ( Exception e1 ) {
            e1.printStackTrace();
        }
        // add import for JUnit assert class
        pconf.addImport( "Assert",
                         Assert.class );

        // compile MVEL expression
        ParserContext mvelctx = new ParserContext( pconf );
        String expression = cmd[3].replaceAll( "h(\\d+)",
View Full Code Here

Examples of org.mvel2.ParserConfiguration

        }
        // add all context variables, just in case
        vars.putAll( context );

        // add the static imports for hamcrest matchers
        ParserConfiguration pconf = new ParserConfiguration();
        addStaticImports( pconf,
                          CoreMatchers.class );
        addStaticImports( pconf,
                          JUnitMatchers.class );
        // add import for JUnit assert class
        pconf.addImport( "Assert",
                         Assert.class );

        // compile MVEL expression
        ParserContext mvelctx = new ParserContext( pconf );
        String expression;
View Full Code Here

Examples of org.mvel2.ParserConfiguration

        }
        // add all context variables, just in case
        vars.putAll( context );

        // add the static imports for hamcrest matchers
        ParserConfiguration pconf = new ParserConfiguration();
        addStaticImports( pconf,
                          CoreMatchers.class );
        addStaticImports( pconf,
                          JUnitMatchers.class );
        // add import for JUnit assert class
        pconf.addImport( "Assert",
                         Assert.class );

        // compile MVEL expression
        ParserContext mvelctx = new ParserContext( pconf );
        String expression = cmd[3].replaceAll( "h(\\d+)",
View Full Code Here

Examples of org.mvel2.ParserConfiguration

                    throw new IllegalArgumentException( "Unable to resolve method of field: " + key + " - " + value, e );

                }
            }

            this.parserConfiguration = new ParserConfiguration();
            this.parserConfiguration.setImports( this.imports );
            this.parserConfiguration.setPackageImports( this.packageImports );
            this.parserConfiguration.setClassLoader( classLoader );
        }
        return this.parserConfiguration;
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.