public function addFileFormat(string $mime_type, $writer_class)
    {
        if (is_string($writer_class))
        {
            if (!class_exists($writer_class) || !(is_subclass_of($writer_class, AbstractWriter::class, $writer_class)))
            {
                throw new InvalidArgumentException(
                    "Class {$writer_class} does not exist or does not implement " . AbstractWriter::class
                );
            }
            $this->file_formats[$mime_type] = $writer_class;    
        }
        elseif ($writer_class instanceof AbstractWriter)
        {
            $this->file_formats[$mime_type] = $writer_class;    
        }
        else
        {
            throw new InvalidArgumentException(
                "Invalid writer specified: " . WF::str($writer_class)
            );
        }

        $this->file_formats[$mime_type] = $writer_class;    
        return $this;
    }