@classmethod
def NewPathSpec(cls, type_indicator, **kwargs):
    """Creates a new path specification for the specific type indicator.

    Args:
      type_indicator (str): type indicator.
      kwargs (dict): keyword arguments depending on the path specification.

    Returns:
      PathSpec: path specification.

    Raises:
      KeyError: if path specification is not registered.
    """
    if type_indicator not in cls._path_spec_types:
        raise KeyError('Path specification type: {0:s} not set.'.format(
            type_indicator))
    if 'parent' in kwargs and kwargs['parent'] is None:
        del kwargs['parent']
    path_spec_type = cls._path_spec_types[type_indicator]
    return path_spec_type(**kwargs)
