use of javax.el.MethodInfo in project tomcat by apache.
the class MethodExpressionImpl method getMethodInfo.
/**
* Evaluates the expression relative to the provided context, and returns
* information about the actual referenced method.
*
* @param context
* The context of this evaluation
* @return an instance of <code>MethodInfo</code> containing information
* about the method the expression evaluated to.
* @throws NullPointerException
* if context is <code>null</code> or the base object is
* <code>null</code> on the last resolution.
* @throws PropertyNotFoundException
* if one of the property resolutions failed because a specified
* variable or property does not exist or is not readable.
* @throws MethodNotFoundException
* if no suitable method can be found.
* @throws ELException
* if an exception was thrown while performing property or
* variable resolution. The thrown exception must be included as
* the cause property of this exception, if available.
* @see javax.el.MethodExpression#getMethodInfo(javax.el.ELContext)
*/
@Override
public MethodInfo getMethodInfo(ELContext context) throws PropertyNotFoundException, MethodNotFoundException, ELException {
Node n = this.getNode();
EvaluationContext ctx = new EvaluationContext(context, this.fnMapper, this.varMapper);
ctx.notifyBeforeEvaluation(getExpressionString());
MethodInfo result = n.getMethodInfo(ctx, this.paramTypes);
ctx.notifyAfterEvaluation(getExpressionString());
return result;
}
use of javax.el.MethodInfo in project tomcat by apache.
the class MethodExpressionLiteral method getMethodInfo.
@Override
public MethodInfo getMethodInfo(ELContext context) throws ELException {
context.notifyBeforeEvaluation(getExpressionString());
MethodInfo result = new MethodInfo(this.expr, this.expectedType, this.paramTypes);
context.notifyAfterEvaluation(getExpressionString());
return result;
}
use of javax.el.MethodInfo in project tomcat by apache.
the class AstValue method getMethodInfo.
@Override
public // Interface el.parser.Node uses raw types (and is auto-generated)
MethodInfo getMethodInfo(EvaluationContext ctx, @SuppressWarnings("rawtypes") Class[] paramTypes) throws ELException {
Target t = getTarget(ctx);
Method m = ReflectionUtil.getMethod(ctx, t.base, t.property, paramTypes, null);
return new MethodInfo(m.getName(), m.getReturnType(), m.getParameterTypes());
}
use of javax.el.MethodInfo in project tomcat by apache.
the class JspMethodExpression method getMethodInfo.
@Override
public MethodInfo getMethodInfo(ELContext context) throws NullPointerException, PropertyNotFoundException, MethodNotFoundException, ELException {
context.notifyBeforeEvaluation(getExpressionString());
try {
MethodInfo result = this.target.getMethodInfo(context);
context.notifyAfterEvaluation(getExpressionString());
return result;
} catch (MethodNotFoundException e) {
if (e instanceof JspMethodNotFoundException)
throw e;
throw new JspMethodNotFoundException(this.mark, e);
} catch (PropertyNotFoundException e) {
if (e instanceof JspPropertyNotFoundException)
throw e;
throw new JspPropertyNotFoundException(this.mark, e);
} catch (ELException e) {
if (e instanceof JspELException)
throw e;
throw new JspELException(this.mark, e);
}
}
Aggregations