Builds descriptive information for a Java field. @param field the field to describe @return the field information array
(Field field)
| 279 | * @return the field information array |
| 280 | */ |
| 281 | protected String[] fieldInfo(Field field) { |
| 282 | String[] result = new String[MEMBER_VALUE_IDX + 1]; |
| 283 | result[MEMBER_ORIGIN_IDX] = JAVA; |
| 284 | result[MEMBER_MODIFIER_IDX] = Modifier.toString(field.getModifiers()); |
| 285 | result[MEMBER_DECLARER_IDX] = shortName(field.getDeclaringClass()); |
| 286 | result[MEMBER_TYPE_IDX] = shortName(field.getType()); |
| 287 | result[MEMBER_NAME_IDX] = field.getName(); |
| 288 | try { |
| 289 | result[MEMBER_VALUE_IDX] = FormatHelper.inspect(field.get(objectUnderInspection)); |
| 290 | } catch (IllegalAccessException e) { |
| 291 | result[MEMBER_VALUE_IDX] = NOT_APPLICABLE; |
| 292 | } |
| 293 | return withoutNulls(result); |
| 294 | } |
| 295 | |
| 296 | /** |
| 297 | * Builds descriptive information for a Groovy property value. |