use of jakarta.el.MethodReference in project tomcat by apache.
the class MethodExpressionImpl method getMethodReference.
@Override
public MethodReference getMethodReference(ELContext context) {
EvaluationContext ctx = new EvaluationContext(context, this.fnMapper, this.varMapper);
ctx.notifyBeforeEvaluation(getExpressionString());
MethodReference methodReference = this.getNode().getMethodReference(ctx);
ctx.notifyAfterEvaluation(getExpressionString());
return methodReference;
}
use of jakarta.el.MethodReference in project tomcat by apache.
the class MethodExpressionLiteral method getMethodReference.
@Override
public MethodReference getMethodReference(ELContext context) {
if (context == null) {
throw new NullPointerException(MessageFactory.get("error.context.null"));
}
context.notifyBeforeEvaluation(getExpressionString());
MethodReference result = new MethodReference(null, getMethodInfoInternal(), EMPTY_ANNOTATION_ARRAY, EMPTY_OBJECT_ARRAY);
context.notifyAfterEvaluation(getExpressionString());
return result;
}
use of jakarta.el.MethodReference in project tomcat by apache.
the class AstValue method getMethodReference.
@Override
public MethodReference getMethodReference(EvaluationContext ctx) {
Target t = getTarget(ctx);
Method m = null;
Object[] values = null;
Class<?>[] types = null;
if (isParametersProvided()) {
values = ((AstMethodParameters) this.jjtGetChild(this.jjtGetNumChildren() - 1)).getParameters(ctx);
types = getTypesFromValues(values);
}
m = ReflectionUtil.getMethod(ctx, t.base, t.property, types, values);
// Handle varArgs and any coercion required
values = convertArgs(ctx, values, m);
return new MethodReference(t.base, getMethodInfo(ctx, types), m.getAnnotations(), values);
}
use of jakarta.el.MethodReference in project tomcat by apache.
the class JspMethodExpression method getMethodReference.
@Override
public MethodReference getMethodReference(ELContext context) {
context.notifyBeforeEvaluation(getExpressionString());
try {
MethodReference result = this.target.getMethodReference(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