protected function registerMetadataService()
    {
        if ($this->getServiceLocator()->has(MetadataService::SERVICE_ID)) {
            $metadataService = $this->getServiceLocator()->get(MetadataService::SERVICE_ID);
        } else {
            $metadataService = $this->getServiceManager()->build(MetadataService::class);
        }
        $metadataService->setOption(MetadataService::IMPORTER_KEY, $this);
        $this->getServiceManager()->register(MetadataService::SERVICE_ID, $metadataService);
    }