public function getOptionMetadata(SwatOption $option, $metadata = null)
    {
        $key = $this->getOptionMetadataKey($option);

        if ($metadata === null) {
            if (isset($this->option_metadata[$key])) {
                $metadata = $this->option_metadata[$key];
            } else {
                $metadata = array();
            }
        } else {
            if (
                isset($this->option_metadata[$key]) &&
                isset($this->option_metadata[$key][$metadata])
            ) {
                $metadata = $this->option_metadata[$key][$metadata];
            } else {
                $metadata = null;
            }
        }

        return $metadata;
    }