public static function toJSON($objValue)
    {
        assert('is_array($objValue) || is_object($objValue)');    // json spec says only arrays or objects can be encoded
        $objValue = self::makeJsonEncodable($objValue);
        $strRet = json_encode($objValue);
        if ($strRet === false) {
            throw new Caller('Json Encoding Error: ' . json_last_error_msg());
        }
        return $strRet;
    }