Package org.mvel

Examples of org.mvel.ExpressionCompiler.compile()


               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


                        try {
                          ExpressionCompiler compiler = new ExpressionCompiler(actionString);
                          compiler.setVerifying(true);
                        ParserContext parserContext = new ParserContext();
                        //parserContext.setStrictTypeEnforcement(true);
                        compiler.compile(parserContext);
                        List mvelErrors = parserContext.getErrorList();
                        if (mvelErrors != null) {
                          for (Iterator iterator = mvelErrors.iterator(); iterator.hasNext(); ) {
                            Object error = iterator.next();
                            errors.add( new RuleFlowProcessValidationErrorImpl( RuleFlowProcessValidationError.ACTION_NODE_WITH_INVALID_ACTION, "name = " + actionNode.getName() + " " + error ) );
View Full Code Here

                }
          }
        }
        TypeResolver typeResolver = new ClassTypeResolver(importSet, Thread.currentThread().getContextClassLoader());
        // compile expression
        Serializable expression = compiler.compile(parserContext);
        // globals
        Map globalDefs = getProcessInstance().getRuleFlowProcess().getGlobals();
        Map globals = new HashMap();
        if (globalDefs != null) {
          for (Iterator iterator = globalDefs.entrySet().iterator(); iterator.hasNext(); ) {
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

        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, final RuleBuildContext context) {
        final ParserContext parserContext = new ParserContext( this.imports,
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, final RuleBuildContext context) {
        final ParserContext parserContext = new ParserContext( imports,
View Full Code Here

        String dummyField = "__DUMMY__";
        String dummyExpr = dummyField+"."+fieldConstraintDescr.getFieldName();
        ExpressionCompiler compiler = new ExpressionCompiler( dummyExpr );
        ParserContext mvelcontext = new ParserContext();
        mvelcontext.addInput( dummyField, ((ClassObjectType) pattern.getObjectType()).getClassType() );
        compiler.compile( mvelcontext );
        Class resultType = compiler.getReturnType();
        return resultType;
    }

    private Restriction createRestriction(final RuleBuildContext context,
View Full Code Here

        //context.setDebugSymbols( true );
        context.setSourceFile( "mysource" );
  
        compiler.setDebugSymbols( true );
       
        Serializable compiledExpression = compiler.compile(context);          
  
        String s = org.mvel.debug.DebugTools.decompile( compiledExpression );
  
        System.out.println("s "+s);
       
View Full Code Here

        //context.setDebugSymbols( true );
        context.setSourceFile( "mysource" );
  
        compiler.setDebugSymbols( true );
       
        Serializable compiledExpression = compiler.compile(context);          
  
        String s = org.mvel.debug.DebugTools.decompile( compiledExpression );
  
        System.out.println("s "+s);
       
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.