public function getJavascript()
    {
        $js = "{\n\tcallback: " . $this->getJavascriptCallback() . ",\n" .
              "\telementId: '" . $this->owner->getId() . "',\n" .
              "\terrorMessage: '" . strtr($this->getMessage(), array(
                    "\r"    => '\r',
                    "\n"    => '\n',
                    "\t"    => '\t',
                    "'"     => "\\'",
                    '"'     => '\"',
                    '\\'    => '\\\\'
              )) . "',\n\tchained: [";
        $chained = array();
        foreach ($this->chainedRules as $item) {
            $multipliers = array();
            foreach ($item as $multiplier) {
                $multipliers[] = $multiplier->getJavascript();
            }
            $chained[] = '[' . implode(",\n", $multipliers) . ']';
        }
        $js .= implode(",\n", $chained) . "]\n}";
        return $js;
    }