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

Method hasSetterMethodFor

src/main/java/groovy/lang/Script.java:97–109  ·  view source on GitHub ↗
(String property)

Source from the content-addressed store, hash-verified

95 }
96
97 private boolean hasSetterMethodFor(String property) {
98 String setterName = GeneralUtils.getSetterName(property);
99 for (Class<?> c = getClass(); !c.equals(Script.class); c = c.getSuperclass()) {
100 for (Method method : c.getDeclaredMethods()) {
101 if (method.getParameterCount() == 1
102 // TODO: Test modifiers or return type?
103 && method.getName().equals(setterName)) {
104 return true;
105 }
106 }
107 }
108 return false;
109 }
110
111 /**
112 * Invoke a method (or closure in the binding) defined.

Callers 1

setPropertyMethod · 0.95

Calls 6

getSetterNameMethod · 0.95
getClassMethod · 0.80
equalsMethod · 0.65
getNameMethod · 0.65
getDeclaredMethodsMethod · 0.45
getParameterCountMethod · 0.45

Tested by

no test coverage detected