MCPcopy
hub / github.com/apache/groovy / fieldInfo

Method fieldInfo

src/main/java/groovy/inspect/Inspector.java:281–294  ·  view source on GitHub ↗

Builds descriptive information for a Java field. @param field the field to describe @return the field information array

(Field field)

Source from the content-addressed store, hash-verified

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.

Callers 4

getPublicFieldsMethod · 0.95
getPropertyInfoMethod · 0.95

Calls 11

shortNameMethod · 0.95
inspectMethod · 0.95
withoutNullsMethod · 0.95
fieldWithInfoMethod · 0.95
toStringMethod · 0.65
getModifiersMethod · 0.65
getTypeMethod · 0.65
getNameMethod · 0.65
getMethod · 0.65
getDeclaringClassMethod · 0.45
getV2Method · 0.45

Tested by 2