Finds a MethodNode matching the given name and parameter signature in this class or any of its superclasses. This method searches the inheritance hierarchy starting from this ClassNode. Parameter matching is done by comparing parameter types using the {@link #parametersEqual(Parameter[], Par
(String name, Parameter[] parameters)
| 1303 | * @see #getMethods(String) |
| 1304 | */ |
| 1305 | public MethodNode getMethod(String name, Parameter[] parameters) { |
| 1306 | boolean zeroParameters = !asBoolean(parameters); |
| 1307 | for (MethodNode method : getMethods(name)) { |
| 1308 | Parameter[] methodParameters = method.getParameters(); |
| 1309 | if (zeroParameters ? methodParameters.length == 0 |
| 1310 | : parametersEqual(methodParameters, parameters)) { |
| 1311 | return method; |
| 1312 | } |
| 1313 | } |
| 1314 | return null; |
| 1315 | } |
| 1316 | |
| 1317 | /** |
| 1318 | * @param type the ClassNode of interest |