Search in sources :

Example 11 with VariableMapper

use of javax.el.VariableMapper in project tomcat70 by apache.

the class AstIdentifier method isReadOnly.

@Override
public boolean isReadOnly(EvaluationContext ctx) throws ELException {
    VariableMapper varMapper = ctx.getVariableMapper();
    if (varMapper != null) {
        ValueExpression expr = varMapper.resolveVariable(this.image);
        if (expr != null) {
            return expr.isReadOnly(ctx.getELContext());
        }
    }
    ctx.setPropertyResolved(false);
    boolean result = ctx.getELResolver().isReadOnly(ctx, null, this.image);
    if (!ctx.isPropertyResolved()) {
        throw new PropertyNotFoundException(MessageFactory.get("error.resolver.unhandled.null", this.image));
    }
    return result;
}
Also used : PropertyNotFoundException(javax.el.PropertyNotFoundException) VariableMapper(javax.el.VariableMapper) ValueExpression(javax.el.ValueExpression)

Example 12 with VariableMapper

use of javax.el.VariableMapper in project tomcat70 by apache.

the class AstIdentifier method getValueReference.

@Override
public ValueReference getValueReference(EvaluationContext ctx) {
    VariableMapper varMapper = ctx.getVariableMapper();
    if (varMapper == null) {
        return null;
    }
    ValueExpression expr = varMapper.resolveVariable(this.image);
    if (expr == null) {
        return null;
    }
    return expr.getValueReference(ctx);
}
Also used : VariableMapper(javax.el.VariableMapper) ValueExpression(javax.el.ValueExpression)

Example 13 with VariableMapper

use of javax.el.VariableMapper in project muikku by otavanopisto.

the class WidgetComponentHandler method includeWidget.

private void includeWidget(FaceletContext context, UIComponent parent, String widgetName) {
    String path = getWidgetPath(widgetName);
    VariableMapper orig = context.getVariableMapper();
    context.setVariableMapper(new VariableMapperWrapper(orig));
    try {
        this.nextHandler.apply(context, null);
        context.includeFacelet(parent, path);
    } catch (IOException e) {
        Logger.getLogger(getClass().getName()).log(Level.SEVERE, "Failed to include widget " + path, e);
    } finally {
        context.setVariableMapper(orig);
    }
}
Also used : VariableMapper(javax.el.VariableMapper) VariableMapperWrapper(com.sun.faces.facelets.el.VariableMapperWrapper) IOException(java.io.IOException)

Aggregations

VariableMapper (javax.el.VariableMapper)13 ValueExpression (javax.el.ValueExpression)7 VariableMapperWrapper (com.sun.faces.facelets.el.VariableMapperWrapper)4 PropertyNotFoundException (javax.el.PropertyNotFoundException)4 IOException (java.io.IOException)3 URL (java.net.URL)3 FunctionMapper (javax.el.FunctionMapper)3 BeanELResolver (javax.el.BeanELResolver)2 ELContext (javax.el.ELContext)2 ELResolver (javax.el.ELResolver)2 LocatedWidget (fi.otavanopisto.muikku.model.widgets.LocatedWidget)1 ArrayELResolver (javax.el.ArrayELResolver)1 CompositeELResolver (javax.el.CompositeELResolver)1 ELException (javax.el.ELException)1 ListELResolver (javax.el.ListELResolver)1 MapELResolver (javax.el.MapELResolver)1 MethodExpression (javax.el.MethodExpression)1 MethodNotFoundException (javax.el.MethodNotFoundException)1 ResourceBundleELResolver (javax.el.ResourceBundleELResolver)1 TagAttributeException (javax.faces.view.facelets.TagAttributeException)1