MCPcopy Create free account
hub / github.com/apache/tomcat / invoke

Method invoke

java/jakarta/el/BeanELResolver.java:124–154  ·  view source on GitHub ↗
(ELContext context, Object base, Object method, Class<?>[] paramTypes, Object[] params)

Source from the content-addressed store, hash-verified

122 }
123
124 @Override
125 public Object invoke(ELContext context, Object base, Object method, Class<?>[] paramTypes, Object[] params) {
126 Objects.requireNonNull(context);
127 if (base == null || method == null) {
128 return null;
129 }
130
131 ExpressionFactory factory = ELManager.getExpressionFactory();
132
133 String methodName = factory.coerceToType(method, String.class);
134
135 // Find the matching method
136 Method matchingMethod = Util.findMethod(context, base.getClass(), base, methodName, paramTypes, params);
137
138 Object[] parameters =
139 Util.buildParameters(context, matchingMethod.getParameterTypes(), matchingMethod.isVarArgs(), params);
140
141 Object result;
142 try {
143 result = matchingMethod.invoke(base, parameters);
144 } catch (IllegalArgumentException | IllegalAccessException e) {
145 throw new ELException(e);
146 } catch (InvocationTargetException e) {
147 Throwable cause = e.getCause();
148 Util.handleThrowable(cause);
149 throw new ELException(cause);
150 }
151
152 context.setPropertyResolved(base, method);
153 return result;
154 }
155
156 @Override
157 public boolean isReadOnly(ELContext context, Object base, Object property) {

Callers 15

testInvoke01Method · 0.95
testInvoke03Method · 0.95
testInvoke05Method · 0.95
testInvoke06Method · 0.95

Calls 10

getExpressionFactoryMethod · 0.95
coerceToTypeMethod · 0.95
findMethodMethod · 0.95
buildParametersMethod · 0.95
handleThrowableMethod · 0.95
invokeMethod · 0.65
getParameterTypesMethod · 0.45
isVarArgsMethod · 0.45
getCauseMethod · 0.45
setPropertyResolvedMethod · 0.45

Tested by 15

testInvoke01Method · 0.76
testInvoke03Method · 0.76
testInvoke05Method · 0.76
testInvoke06Method · 0.76