Package org.mvel2.integration.impl

Examples of org.mvel2.integration.impl.CachedMapVariableResolverFactory


    public <T> T evaluate(String expression, Map<String, Object> vars)
    {
        MVELExpressionLanguageContext context = createExpressionLanguageContext();
        if (vars != null)
        {
            context.setNextFactory(new CachedMapVariableResolverFactory(vars,
                new DelegateVariableResolverFactory(staticContext, globalContext)));
        }
        else
        {
            context.setNextFactory(new DelegateVariableResolverFactory(staticContext, globalContext));
View Full Code Here


    public <T> T evaluate(String expression, MuleEvent event, Map<String, Object> vars)
    {
        MVELExpressionLanguageContext context = createExpressionLanguageContext();
        if (vars != null)
        {
            context.setNextFactory(new CachedMapVariableResolverFactory(vars,
                new DelegateVariableResolverFactory(staticContext, new EventVariableResolverFactory(
                    parserConfiguration, muleContext, event, new DelegateVariableResolverFactory(
                        globalContext, createVariableVariableResolverFactory(event))))));
        }
        else
View Full Code Here

    public <T> T evaluate(String expression, MuleMessage message, Map<String, Object> vars)
    {
        MVELExpressionLanguageContext context = createExpressionLanguageContext();
        if (vars != null)
        {
            context.setNextFactory(new CachedMapVariableResolverFactory(vars,
                new DelegateVariableResolverFactory(staticContext, new MessageVariableResolverFactory(
                    parserConfiguration, muleContext, message, new DelegateVariableResolverFactory(
                        globalContext, createVariableVariableResolverFactory(message))))));
        }
        else
View Full Code Here

                                //parserContext.setStrictTypeEnforcement(true);
                                compiler.compile(parserContext);
                                List<ErrorDetail> mvelErrors = parserContext.getErrorList();
                                if (mvelErrors != null) {
                                    for (Iterator<ErrorDetail> iterator = mvelErrors.iterator(); iterator.hasNext(); ) {
                                        ErrorDetail error = iterator.next();
                                        errors.add(new ProcessValidationErrorImpl(process,
                                            "Action node '" + node.getName() + "' [" + node.getId() + "] has invalid action: " + error.getMessage() + "."));
                                    }
                                }
                            } catch (Throwable t) {
                                errors.add(new ProcessValidationErrorImpl(process,
                                    "Action node '" + node.getName() + "' [" + node.getId() + "] has invalid action: " + t.getMessage() + "."));
View Full Code Here

                                                          "Unable to build expression for action '" + actionDescr.getText() + "' :" + e ) );
        }
    }

    public static String processMacros(String consequence) {
        MacroProcessor macroProcessor = new MacroProcessor();
        macroProcessor.setMacros( macros );
        return macroProcessor.parse( delimitExpressions( consequence ) );
    }
View Full Code Here

    public static String fix(final String raw) {
        if  ( raw == null || "".equals( raw.trim() )) {
            return raw;
        }
       
        MacroProcessor macroProcessor = new MacroProcessor();
        macroProcessor.setMacros( macros );
        return macroProcessor.parse( raw );
    }
View Full Code Here

                                                          "Unable to build expression for action '" + actionDescr.getText() + "' :" + e ) );
        }
    }

    public static String processMacros(String consequence) {
        MacroProcessor macroProcessor = new MacroProcessor();
        macroProcessor.setMacros( macros );
        return macroProcessor.parse( delimitExpressions( consequence ) );
    }
View Full Code Here

        }
    }

    public Object eval(String str,
                       Map vars) {
      ParserConfiguration pconf = new ParserConfiguration();
      pconf.addPackageImport("org.jbpm.task");
      pconf.addPackageImport("org.jbpm.task.service");
      pconf.addPackageImport("org.jbpm.task.query");
      pconf.addPackageImport("java.util");
      for(String entry : getInputs().keySet()){
        pconf.addImport(entry, getInputs().get(entry));
        }
      ParserContext context = new ParserContext(pconf);
        Serializable s = MVEL.compileExpression(str.trim(), context);
        return MVEL.executeExpression(s, vars);
    }
View Full Code Here

        languageLevel = in.readInt();
        strictMode = 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

    protected void setInputs( RuleBuildContext context,
                            ExprBindings descrBranch,
                            Class< ? > thisClass,
                            String expr ) {
        MVELDialectRuntimeData data = (MVELDialectRuntimeData) context.getPkg().getDialectRuntimeRegistry().getDialectData( "mvel" );
        ParserConfiguration conf = data.getParserConfiguration();

        conf.setClassLoader( context.getKnowledgeBuilder().getRootClassLoader() );

        final ParserContext pctx = new ParserContext( conf );
        pctx.setStrictTypeEnforcement(false);
        pctx.setStrongTyping( false );
        pctx.addInput( "this",
View Full Code Here

TOP

Related Classes of org.mvel2.integration.impl.CachedMapVariableResolverFactory

Copyright © 2018 www.massapicom. 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.