MCPcopy Create free account
hub / github.com/SeleniumHQ/selenium / findSetter

Method findSetter

java/src/org/openqa/selenium/grid/jmx/MBean.java:158–175  ·  view source on GitHub ↗
(Method annotatedMethod)

Source from the content-addressed store, hash-verified

156 }
157
158 private @Nullable Method findSetter(Method annotatedMethod) {
159 ManagedAttribute ma = annotatedMethod.getAnnotation(ManagedAttribute.class);
160 if (!"".equals(ma.setter())) {
161 return findMethod(annotatedMethod.getDeclaringClass(), ma.setter());
162 } else {
163 String name = annotatedMethod.getName();
164 if (name.startsWith("set")) {
165 return annotatedMethod;
166 }
167 if (name.startsWith("get")) {
168 findMethod(annotatedMethod.getDeclaringClass(), "s" + name.substring(1));
169 }
170 if (name.startsWith("is")) {
171 findMethod(annotatedMethod.getDeclaringClass(), "set" + name.substring(2));
172 }
173 }
174 return null;
175 }
176
177 private @Nullable Method findMethod(Class<?> cls, String name) {
178 return Stream.of(cls.getMethods())

Callers 1

getAttributeInfoMethod · 0.95

Calls 3

findMethodMethod · 0.95
getNameMethod · 0.65
equalsMethod · 0.45

Tested by

no test coverage detected