List of usage examples for javax.el CompositeELResolver CompositeELResolver
public CompositeELResolver()
From source file:com.github.htfv.maven.plugins.buildconfigurator.core.el.BuildConfiguratorELResolver.java
/** * Creates a new instance of EL resolver which may be used for expression * evaluation. Returned resolver includes not only * {@code BuildConfiguratorELResolver}, but also all standard resolvers. * * @param mavenProject// www. j av a 2 s . c om * reference to the configured Maven project. Used to resolve * properties referenced in EL expressions. * @param configuration * loaded property files. * * @return new instance of EL resolver. */ public static ELResolver newInstance(final MavenProject mavenProject, final Configuration configuration) { final CompositeELResolver elResolver = new CompositeELResolver(); elResolver.add(new BuildConfiguratorELResolver(mavenProject, configuration)); elResolver.add(new ArrayELResolver()); elResolver.add(new ListELResolver()); elResolver.add(new MapELResolver()); elResolver.add(new ResourceBundleELResolver()); // // BeanELResolver should be the last one. // elResolver.add(new BeanELResolver()); return elResolver; }
From source file:biz.netcentric.cq.tools.actool.configreader.YamlMacroElEvaluator.java
public YamlMacroElEvaluator() { try {// w w w . ja va 2 s. co m Class<?> expressionFactoryClass = getClass().getClassLoader() .loadClass("org.apache.el.ExpressionFactoryImpl"); expressionFactory = (ExpressionFactory) expressionFactoryClass.newInstance(); } catch (ClassNotFoundException | InstantiationException | IllegalAccessException e) { throw new IllegalStateException("Could not init EL: " + e); } final VariableMapper variableMapper = new ElVariableMapper(); final ElFunctionMapper functionMapper = new ElFunctionMapper(); final CompositeELResolver compositeELResolver = new CompositeELResolver(); compositeELResolver.add(new BaseELResolver()); compositeELResolver.add(new ArrayELResolver()); compositeELResolver.add(new ListELResolver()); compositeELResolver.add(new BeanELResolver()); compositeELResolver.add(new MapELResolver()); context = new ELContext() { @Override public ELResolver getELResolver() { return compositeELResolver; } @Override public FunctionMapper getFunctionMapper() { return functionMapper; } @Override public VariableMapper getVariableMapper() { return variableMapper; } }; }
From source file:io.undertow.test.jsp.expression.ExpressionJspTestCase.java
public static void testIIllegalState(PageContext pageContext, JspWriter out) throws Exception { assert pageContext != null; ELContext elContext = pageContext.getELContext(); assert elContext != null; JspApplicationContext jaContext = JspFactory.getDefaultFactory() .getJspApplicationContext(pageContext.getServletContext()); assert jaContext != null; try {/*from w ww. j a v a2s .co m*/ jaContext.addELResolver(new CompositeELResolver()); out.println("addELResolver call succeeded. Test FAILED."); } catch (IllegalStateException ise) { out.println("Test PASSED"); } }
From source file:org.apache.camel.language.juel.JuelExpression.java
/** * Factory method to create the EL context *//*from w ww . j a va 2 s . c om*/ protected ELContext createContext() { ELResolver resolver = new CompositeELResolver() { { //add(methodResolver); add(new ArrayELResolver(false)); add(new ListELResolver(false)); add(new MapELResolver(false)); add(new ResourceBundleELResolver()); add(new BeanAndMethodELResolver()); } }; return new SimpleContext(resolver); }
From source file:org.apache.myfaces.application.ApplicationImpl.java
private ELResolver createFacesResolver() { boolean supportJSPAndFacesEL = MyfacesConfig.getCurrentInstance(getFaceContext().getExternalContext()) .isSupportJSPAndFacesEL();// w w w .j av a 2 s . c o m CompositeELResolver resolver; if (supportJSPAndFacesEL) { resolver = new FacesCompositeELResolver(Scope.Faces); } else { resolver = new CompositeELResolver(); } getResolverBuilderForFaces().build(resolver); return resolver; }
From source file:org.tinygroup.jspengine.runtime.PageContextImpl.java
private ELResolver getELResolver() { if (elResolver == null) { // Create a CompositeELResolver CompositeELResolver celResolver = new CompositeELResolver(); celResolver.add(new ImplicitObjectELResolver()); // Add ELResolvers registered in JspApplicationContext JspApplicationContextImpl jaContext = getJspApplicationContext(); Iterator<ELResolver> it = jaContext.getELResolvers(); while (it.hasNext()) { celResolver.add(it.next());// w ww .j av a2s . com } celResolver.add(new MapELResolver()); celResolver.add(new ResourceBundleELResolver()); celResolver.add(new ListELResolver()); celResolver.add(new ArrayELResolver()); celResolver.add(new BeanELResolver()); celResolver.add(new ScopedAttributeELResolver()); elResolver = celResolver; } return elResolver; }
From source file:therian.Therian.java
public TherianContext contextFor(ELContext wrapped) { final TherianContext result = new TherianContext(new ELContextWrapper(wrapped) { @Override//from w w w .ja va 2 s . c om protected ELResolver wrap(ELResolver elResolver) { final CompositeELResolver compositeResolver = new CompositeELResolver(); for (TherianModule module : modules) { for (ELResolver configuredELResolver : module.getElResolvers()) { compositeResolver.add(configuredELResolver); } } compositeResolver.add(elResolver); return compositeResolver; } }, operatorManager); result.putContext(Therian.class, this); final ELContextEvent event = new ELContextEvent(result); for (TherianModule module : modules) { for (ELContextListener listener : module.getElContextListeners()) { listener.contextCreated(event); } } return result; }