use of javax.el.ELResolver in project sling by apache.
the class JspApplicationContextImpl method createELContext.
public ELContextImpl createELContext(JspContext context) {
if (context == null) {
throw new IllegalArgumentException("JspContext was null");
}
// create ELContext for JspContext
ELResolver r = this.createELResolver();
ELContextImpl ctx = new ELContextImpl(r);
ctx.putContext(JspContext.class, context);
// alert all ELContextListeners
ELContextEvent event = new ELContextEvent(ctx);
for (int i = 0; i < this.contextListeners.size(); i++) {
this.contextListeners.get(i).contextCreated(event);
}
return ctx;
}
use of javax.el.ELResolver in project camel by apache.
the class JuelExpression method createContext.
/**
* Factory method to create the EL context
*/
protected ELContext createContext() {
ELResolver resolver = new CompositeELResolver() {
{
add(new ArrayELResolver(false));
add(new ListELResolver(false));
add(new MapELResolver(false));
add(new ResourceBundleELResolver());
add(new BeanAndMethodELResolver());
}
};
return new SimpleContext(resolver);
}
use of javax.el.ELResolver in project core by weld.
the class WeldTestPhaseListener method testELResolver.
private void testELResolver(String name) {
FacesContext facesContext = FacesContext.getCurrentInstance();
ELResolver resolver = facesContext.getApplication().getELResolver();
ELContext elContext = facesContext.getELContext();
Object object = resolver.getValue(elContext, null, name);
if (object == null)
throw new NullPointerException("ELResolver returned null");
}
use of javax.el.ELResolver in project core by weld.
the class ELImpl method createELContext.
private ELContext createELContext(BeanManagerImpl beanManagerImpl) {
final ELResolver resolver = createELResolver(beanManagerImpl);
ELContext context = new ELContext() {
@Override
public ELResolver getELResolver() {
return resolver;
}
@Override
public FunctionMapper getFunctionMapper() {
return null;
}
@Override
public VariableMapper getVariableMapper() {
return null;
}
};
callELContextListeners(context);
return context;
}
use of javax.el.ELResolver in project tomcat70 by apache.
the class AstValue method getValue.
@Override
public Object getValue(EvaluationContext ctx) throws ELException {
Object base = this.children[0].getValue(ctx);
int propCount = this.jjtGetNumChildren();
int i = 1;
Object suffix = null;
ELResolver resolver = ctx.getELResolver();
while (base != null && i < propCount) {
suffix = this.children[i].getValue(ctx);
if (i + 1 < propCount && (this.children[i + 1] instanceof AstMethodParameters)) {
AstMethodParameters mps = (AstMethodParameters) this.children[i + 1];
// This is a method
Object[] paramValues = mps.getParameters(ctx);
base = resolver.invoke(ctx, base, suffix, getTypesFromValues(paramValues), paramValues);
i += 2;
} else {
// This is a property
if (suffix == null) {
return null;
}
ctx.setPropertyResolved(false);
base = resolver.getValue(ctx, base, suffix);
i++;
}
}
if (!ctx.isPropertyResolved()) {
throw new PropertyNotFoundException(MessageFactory.get("error.resolver.unhandled", base, suffix));
}
return base;
}
Aggregations