Builds the value and metadata tuple for a Groovy property. @param pv the property value to describe @return the property tuple
(PropertyValue pv)
| 325 | * @return the property tuple |
| 326 | */ |
| 327 | protected Tuple2<Object, String[]> fieldWithInfo(PropertyValue pv) { |
| 328 | String[] info = new String[MEMBER_VALUE_IDX + 1]; |
| 329 | info[MEMBER_ORIGIN_IDX] = GROOVY; |
| 330 | info[MEMBER_MODIFIER_IDX] = "public"; |
| 331 | info[MEMBER_DECLARER_IDX] = NOT_APPLICABLE; |
| 332 | info[MEMBER_TYPE_IDX] = shortName(pv.getType()); |
| 333 | info[MEMBER_NAME_IDX] = pv.getName(); |
| 334 | Object field = null; |
| 335 | try { |
| 336 | field = pv.getValue(); |
| 337 | info[MEMBER_VALUE_IDX] = FormatHelper.inspect(field); |
| 338 | } catch (Exception e) { |
| 339 | info[MEMBER_VALUE_IDX] = NOT_APPLICABLE; |
| 340 | } |
| 341 | info = withoutNulls(info); |
| 342 | return new Tuple2<>(field, info); |
| 343 | } |
| 344 | |
| 345 | /** |
| 346 | * Gets the class of the inspected object. |