if (managedAttr != null) {
String property = prefix + getPropertyFromBeanConvention(ctField);
Element metric = doc.createElement("metric");
metric.setAttribute("property", property);
String displayName = withNamePrefix ? "[" + mbean.objectName() + "] " + managedAttr.displayName() : managedAttr.displayName();
validateDisplayName(displayName);
metric.setAttribute("property", property);
metric.setAttribute("displayName", displayName);
metric.setAttribute("displayType", managedAttr.displayType().toString());
metric.setAttribute("dataType", managedAttr.dataType().toString());