Search in sources :

Example 36 with ExpressionFactory

use of javax.el.ExpressionFactory in project wildfly by wildfly.

the class JspApplicationContextWrapper method getExpressionFactory.

@Override
public ExpressionFactory getExpressionFactory() {
    if (factory == null) {
        synchronized (this) {
            if (factory == null) {
                ExpressionFactory tmpfactory = delegate.getExpressionFactory();
                for (ExpressionFactoryWrapper wrapper : wrapperList) {
                    tmpfactory = wrapper.wrap(tmpfactory, servletContext);
                }
                factory = tmpfactory;
            }
        }
    }
    return factory;
}
Also used : ExpressionFactory(javax.el.ExpressionFactory) ExpressionFactoryWrapper(org.jboss.as.web.common.ExpressionFactoryWrapper)

Example 37 with ExpressionFactory

use of javax.el.ExpressionFactory in project Payara by payara.

the class WeldContextListenerTest method testcontextInitialized.

@Test
public void testcontextInitialized() throws Exception {
    EasyMockSupport mockSupport = new EasyMockSupport();
    ELResolver elResolver = mockSupport.createMock(ELResolver.class);
    ExpressionFactory expressionFactory = mockSupport.createMock(ExpressionFactory.class);
    StandardContext servletContext = new StandardContext();
    servletContext.getServletContext();
    ServletContextEvent servletContextEvent = mockSupport.createMock(ServletContextEvent.class);
    BeanManager beanManager = mockSupport.createMock(BeanManager.class);
    JspApplicationContextImpl jspApplicationContext = new JspApplicationContextImpl(servletContext);
    expect(beanManager.getELResolver()).andReturn(elResolver);
    expect(beanManager.wrapExpressionFactory(isA(ExpressionFactory.class))).andReturn(expressionFactory);
    mockSupport.replayAll();
    WeldContextListener weldContextListener = getWeldContextListener(beanManager, jspApplicationContext);
    weldContextListener.contextInitialized(servletContextEvent);
    assertSame(expressionFactory, jspApplicationContext.getExpressionFactory());
    validateJspApplicationContext(jspApplicationContext, elResolver);
    mockSupport.verifyAll();
    mockSupport.resetAll();
}
Also used : EasyMockSupport(org.easymock.EasyMockSupport) ELResolver(javax.el.ELResolver) ExpressionFactory(javax.el.ExpressionFactory) JspApplicationContextImpl(org.apache.jasper.runtime.JspApplicationContextImpl) StandardContext(org.apache.catalina.core.StandardContext) BeanManager(javax.enterprise.inject.spi.BeanManager) ServletContextEvent(javax.servlet.ServletContextEvent) Test(org.junit.Test)

Example 38 with ExpressionFactory

use of javax.el.ExpressionFactory in project oxCore by GluuFederation.

the class FacesMessages method evalAsString.

public String evalAsString(String expression) {
    if (facesContext == null) {
        return expression;
    }
    ExpressionFactory expressionFactory = facesContext.getApplication().getExpressionFactory();
    ELContext elContext = facesContext.getELContext();
    ValueExpression valueExpression = expressionFactory.createValueExpression(elContext, expression, String.class);
    String result = (String) valueExpression.getValue(elContext);
    return result;
}
Also used : ELContext(javax.el.ELContext) ExpressionFactory(javax.el.ExpressionFactory) ValueExpression(javax.el.ValueExpression)

Example 39 with ExpressionFactory

use of javax.el.ExpressionFactory in project camunda-engine-dmn by camunda.

the class FeelEngineFactoryImpl method createFeelEngine.

protected FeelEngine createFeelEngine() {
    FeelToJuelTransform transform = createFeelToJuelTransform();
    ExpressionFactory expressionFactory = createExpressionFactory();
    ElContextFactory elContextFactory = createElContextFactory();
    Cache<TransformExpressionCacheKey, String> transformExpressionCache = createTransformExpressionCache();
    return new FeelEngineImpl(transform, expressionFactory, elContextFactory, transformExpressionCache);
}
Also used : ExpressionFactory(javax.el.ExpressionFactory) FeelToJuelTransform(org.camunda.bpm.dmn.feel.impl.juel.transform.FeelToJuelTransform) ElContextFactory(org.camunda.bpm.dmn.feel.impl.juel.el.ElContextFactory) FeelElContextFactory(org.camunda.bpm.dmn.feel.impl.juel.el.FeelElContextFactory)

Aggregations

ExpressionFactory (javax.el.ExpressionFactory)39 ValueExpression (javax.el.ValueExpression)28 Test (org.junit.Test)24 ELContext (javax.el.ELContext)22 ELContextImpl (org.apache.jasper.el.ELContextImpl)15 ELException (javax.el.ELException)4 ValueReference (javax.el.ValueReference)3 IOException (java.io.IOException)2 StringTokenizer (java.util.StringTokenizer)2 BeanManager (javax.enterprise.inject.spi.BeanManager)2 FacesException (javax.faces.FacesException)2 FacesContext (javax.faces.context.FacesContext)2 ExpressionFactoryImpl (de.odysseus.el.ExpressionFactoryImpl)1 SimpleContext (de.odysseus.el.util.SimpleContext)1 PrivilegedActionException (java.security.PrivilegedActionException)1 PrivilegedExceptionAction (java.security.PrivilegedExceptionAction)1 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 ELResolver (javax.el.ELResolver)1 ServletContextEvent (javax.servlet.ServletContextEvent)1