protected function getFormatter()
    {
        if ($this->formatter) {
            return $this->formatter;
        }

        if (!$this->formatterFactory) {
            throw new RuntimeException("Please call setFormatterFactory() first.");
        }

        return $this->formatter = $this->formatterFactory->create();
    }