| Revision | 246 (tree) |
|---|---|
| Time | 2016-04-26 22:28:32 |
| Author | t_nakayama1971 |
(empty log message)
| @@ -300,6 +300,19 @@ | ||
| 300 | 300 | } |
| 301 | 301 | |
| 302 | 302 | /** |
| 303 | + * Setter確認 | |
| 304 | + * @param mt メソッド | |
| 305 | + * @return Setterの場合 true を返す。 | |
| 306 | + */ | |
| 307 | + public static boolean isSetter(final Method mt) { | |
| 308 | + return mt != null && Modifier.isPublic(mt.getModifiers()) | |
| 309 | + && !Modifier.isStatic(mt.getModifiers()) && !mt.isBridge() && !mt.isSynthetic() | |
| 310 | + && mt.getName().startsWith("set") | |
| 311 | + && mt.getParameterCount() == 1 | |
| 312 | + && !Object.class.equals(mt.getDeclaringClass()); | |
| 313 | + } | |
| 314 | + | |
| 315 | + /** | |
| 303 | 316 | * メソッドから項目名取得 |
| 304 | 317 | * @param mt メソッド |
| 305 | 318 | * @return 項目名 |