(Method annotatedMethod)
| 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()) |
no test coverage detected