<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def register_class_for_json( cls: ClassType, method: str = METHOD_SIMPLE, obj_to_dict_fn: InstanceToDictFnType = None, dict_to_obj_fn: DictToInstanceFnType = initdict_to_instance, default_factory: DefaultFactoryFnType = None) -> None: """ Registers the class cls for JSON serialization. - If both ``obj_to_dict_fn`` and dict_to_obj_fn are registered, the framework uses these to convert instances of the class to/from Python dictionaries, which are in turn serialized to JSON. - Otherwise: .. code-block:: python if method == 'simple': if method == 'strip_underscore': """

    typename = cls.__qualname__  # preferable to __name__
    # ... __name__ looks like "Thing" and is ambiguous
    # ... __qualname__ looks like "my.module.Thing" and is not
    if obj_to_dict_fn and dict_to_obj_fn:
        descriptor = JsonDescriptor(
            typename=typename,
            obj_to_dict_fn=obj_to_dict_fn,
            dict_to_obj_fn=dict_to_obj_fn,
            cls=cls,
            default_factory=default_factory)
    elif method == METHOD_SIMPLE:
        descriptor = JsonDescriptor(
            typename=typename,
            obj_to_dict_fn=instance_to_initdict_simple,
            dict_to_obj_fn=initdict_to_instance,
            cls=cls,
            default_factory=default_factory)
    elif method == METHOD_STRIP_UNDERSCORE:
        descriptor = JsonDescriptor(
            typename=typename,
            obj_to_dict_fn=instance_to_initdict_stripping_underscores,
            dict_to_obj_fn=initdict_to_instance,
            cls=cls,
            default_factory=default_factory)
    else:
        raise ValueError("Unknown method, and functions not fully specified")
    global TYPE_MAP
    TYPE_MAP[typename] = descriptor