protected function checkStartHashElement($data)
    {
        $this->checkStart('hashElement', $data, array('document', 'objectElement', 'hashElement', 'list'));

        $last = count($this->stack) - 2;
        if ($this->stack[$last][0] !== 'list') {
            // Ensure hash element type only occurs once outside of lists
            if (isset($this->stack[$last][2][$data])) {
                throw new Exceptions\OutputGeneratorException(
                    "Element {$data} may only occur once inside of {$this->stack[$last][0]}."
                );
            }
        }
        $this->stack[$last][2][$data] = true;
    }