code: private void extractValues(String path, Map<String, Object> values, CompositeData obj) {
      for (String key : obj.getCompositeType().keySet()) {
        String newPath = (path == null) ? key : path + "." + key;
        Object value = obj.get(key);
        if (value instanceof CompositeData) {
          extractValues(newPath, values, (CompositeData) value);
        } else if (value != null) {
          values.put(newPath, value);
        }
      }
    }
docs: Recursively extracts simple numeric values from composite data objects.
  The map {@code values} will be populated with a path to the value as
  the key and the simple object as the value.