public function setDocumentTypesConfig(array $documentTypes)
    {
        foreach ($documentTypes as $name => $class) {
            $documentType = new $class;
            if (!$documentType instanceof AbstractDocumentType) {
                throw new GeneratorServiceException(
                    'Configured class of document type must be descendant of'
                        . ' Infotech\DocumentGenerator\DocumentType\AbstractDocumentType class'
                );
            }
            $this->registerDocumentType($name, $documentType);
        }
    }