MCPcopy Index your code
hub / github.com/apache/groovy / getMethod

Method getMethod

src/main/java/org/codehaus/groovy/ast/ClassNode.java:1305–1315  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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

Callers 15

visitPropertyMethod · 0.95
hasMethodMethod · 0.95
existsPropertyMethod · 0.95
execGroovyMethod · 0.45
expandGlobMethod · 0.45
doMethodCandidatesMethod · 0.45
isCloneableMethod · 0.45
visitInterfacesMethod · 0.45

Calls 4

getMethodsMethod · 0.95
parametersEqualMethod · 0.95
asBooleanMethod · 0.45
getParametersMethod · 0.45