Package org.mule.mvel2

Examples of org.mule.mvel2.ParserConfiguration


    private final ParserConfiguration parserConfiguration;

    @Inject public MvelScriptEngineService(Settings settings) {
        super(settings);

        parserConfiguration = new ParserConfiguration();
        parserConfiguration.addPackageImport("java.util");
        parserConfiguration.addPackageImport("org.elasticsearch.common.trove");
        parserConfiguration.addPackageImport("org.elasticsearch.common.joda");
        parserConfiguration.addImport("time", MVEL.getStaticMethod(System.class, "currentTimeMillis", new Class[0]));
        // unboxed version of Math, better performance since conversion from boxed to unboxed my mvel is not needed
View Full Code Here


        super(name, value, type, new VariableAssignmentCallback<T>()
        {
            @Override
            public void assignValue(String name, T value, T newValue)
            {
                throw new ImmutableElementException(
                    CoreMessages.expressionFinalVariableCannotBeAssignedValue(name).getMessage());
            }
        });
    }
View Full Code Here

        addVariable(name, value, new VariableAssignmentCallback<T>()
        {
            @Override
            public void assignValue(String name, T value, T newValue)
            {
                throw new ImmutableElementException(
                    CoreMessages.expressionFinalVariableCannotBeAssignedValue(name).getMessage());
            }
        });
    }
View Full Code Here

        return new MVELExpressionLanguageContext(parserConfiguration, muleContext);
    }

    protected ParserConfiguration createParserConfiguration()
    {
        ParserConfiguration ParserConfiguration = new ParserConfiguration();
        configureParserConfiguration(ParserConfiguration);
        return ParserConfiguration;
    }
View Full Code Here

    protected DateTimeExpressionLanguageFuntion dateTimeFunction;

    @Before
    public void setup() throws InitialisationException
    {
        ParserConfiguration parserConfiguration = new ParserConfiguration();
        expressionExecutor = new MVELExpressionExecutor(parserConfiguration);
        context = new MVELExpressionLanguageContext(parserConfiguration, Mockito.mock(MuleContext.class));
        dateTimeFunction = new DateTimeExpressionLanguageFuntion();
        context.declareFunction("dateTime", dateTimeFunction);
    }
View Full Code Here

    }

    @Before
    public void setupMVEL() throws InitialisationException
    {
        mvel = new MVELExpressionExecutor(new ParserConfiguration());
        context = Mockito.mock(MVELExpressionLanguageContext.class);
        Mockito.when(context.isResolveable(Mockito.anyString())).thenReturn(false);
    }
View Full Code Here

    protected RegexExpressionLanguageFuntion regexFuntion;

    @Before
    public void setup() throws InitialisationException
    {
        ParserConfiguration parserConfiguration = new ParserConfiguration();
        expressionExecutor = new MVELExpressionExecutor(parserConfiguration);
        context = new MVELExpressionLanguageContext(parserConfiguration, Mockito.mock(MuleContext.class));
        regexFuntion = new RegexExpressionLanguageFuntion();
        context.declareFunction("regex", regexFuntion);
    }
View Full Code Here

    protected WildcardExpressionLanguageFuntion wildcardFunction;

    @Before
    public void setup() throws InitialisationException
    {
        ParserConfiguration parserConfiguration = new ParserConfiguration();
        expressionExecutor = new MVELExpressionExecutor(parserConfiguration);
        context = new MVELExpressionLanguageContext(parserConfiguration, Mockito.mock(MuleContext.class));
        wildcardFunction = new WildcardExpressionLanguageFuntion();
        context.declareFunction("wildcard", wildcardFunction);
    }
View Full Code Here

            .build(new CacheLoader<String, Serializable>()
            {
                @Override
                public Serializable load(String key) throws Exception
                {
                    return MVEL.compileExpression(key, new ParserContext(parserConfiguration));
                }
            });
    }
View Full Code Here

    public void declareFunction(String name, ExpressionLanguageFunction function)
    {
        try
        {
            addFinalVariable(name, new FunctionInstance(new MVELFunctionAdaptor(name, function,
                    new ParserContext(parserConfiguration))));
        }
        finally
        {
            // Clear AbstractParser.parserContext ThreadLocal once Function has been created.
            AbstractParser.resetParserContext();
View Full Code Here

TOP

Related Classes of org.mule.mvel2.ParserConfiguration

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.