import javax.el.MethodExpression;
import javax.el.MethodInfo;
import javax.el.MethodNotFoundException;
+import javax.el.PropertyNotFoundException;
import javax.el.ValueExpression;
import javax.el.VariableMapper;
import org.apache.el.lang.EvaluationContext;
+import org.apache.el.util.MessageFactory;
/**
}
}
ctx.setPropertyResolved(false);
- return ctx.getELResolver().getType(ctx, null, this.image);
+ Class<?> result = ctx.getELResolver().getType(ctx, null, this.image);
+ if (!ctx.isPropertyResolved()) {
+ throw new PropertyNotFoundException(MessageFactory.get(
+ "error.resolver.unhandled.null", this.image));
+ }
+ return result;
}
@Override
}
}
ctx.setPropertyResolved(false);
- return ctx.getELResolver().getValue(ctx, null, this.image);
+ Object result = ctx.getELResolver().getValue(ctx, null, this.image);
+ if (!ctx.isPropertyResolved()) {
+ throw new PropertyNotFoundException(MessageFactory.get(
+ "error.resolver.unhandled.null", this.image));
+ }
+ return result;
}
@Override
}
}
ctx.setPropertyResolved(false);
- return ctx.getELResolver().isReadOnly(ctx, null, this.image);
+ 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;
}
@Override
}
ctx.setPropertyResolved(false);
ctx.getELResolver().setValue(ctx, null, this.image, value);
+ if (!ctx.isPropertyResolved()) {
+ throw new PropertyNotFoundException(MessageFactory.get(
+ "error.resolver.unhandled.null", this.image));
+ }
}
@Override
public Class<?> getType(EvaluationContext ctx) throws ELException {
Target t = getTarget(ctx);
ctx.setPropertyResolved(false);
- return ctx.getELResolver().getType(ctx, t.base, t.property);
+ Class<?> result = ctx.getELResolver().getType(ctx, t.base, t.property);
+ if (!ctx.isPropertyResolved()) {
+ throw new PropertyNotFoundException(MessageFactory.get(
+ "error.resolver.unhandled", t.base, t.property));
+ }
+ return result;
}
private final Target getTarget(EvaluationContext ctx) throws ELException {
i++;
}
}
+ if (!ctx.isPropertyResolved()) {
+ throw new PropertyNotFoundException(MessageFactory.get(
+ "error.resolver.unhandled", base, suffix));
+ }
return base;
}
public boolean isReadOnly(EvaluationContext ctx) throws ELException {
Target t = getTarget(ctx);
ctx.setPropertyResolved(false);
- return ctx.getELResolver().isReadOnly(ctx, t.base, t.property);
+ boolean result =
+ ctx.getELResolver().isReadOnly(ctx, t.base, t.property);
+ if (!ctx.isPropertyResolved()) {
+ throw new PropertyNotFoundException(MessageFactory.get(
+ "error.resolver.unhandled", t.base, t.property));
+ }
+ return result;
}
@Override
} else {
resolver.setValue(ctx, t.base, t.property, value);
}
+ if (!ctx.isPropertyResolved()) {
+ throw new PropertyNotFoundException(MessageFactory.get(
+ "error.resolver.unhandled", t.base, t.property));
+ }
}
private boolean isAssignable(Object value, Class<?> targetClass) {