def METHOD_NAME(self):
    """Converts the component tree into a dictionary."""
    rv = {
        "id": self.id,
        "name": self.name,
        "contributes": self.contributes,
        "hint": self.hint,
        "values": [],
    }
    for value in self.values:
        if isinstance(value, GroupingComponent):
            rv["values"].append(value.METHOD_NAME())
        else:
            # this basically assumes that a value is only a primitive
            # and never an object or list.  This should be okay
            # because we verify this.
            rv["values"].append(value)
    return rv