You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
4 lines
8.6 KiB
4 lines
8.6 KiB
<!DOCTYPE html><meta charset="UTF-8"><meta http-equiv="Content-Language" content="en" /><title>goog.json.Serializer</title><link href="dossier.css" rel="stylesheet" type="text/css"><div id="main-wrapper"><input type="checkbox" id="sidenav-toggle" /><main><header><h1>Class goog.json.Serializer</h1><a class="source" href="source/lib/goog/json/json.js.src.html#l179">code »</a></header><section><p>Class that is used to serialize JSON objects to a string.<h2>Constructor</h2><div class="ctor wrap-details public"><div><div class="ctor"><span class="member">goog.json.Serializer <span class="args">( opt_replacer )</span></span></div><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>opt_replacer: <code class="type">?<a href="namespace_goog_json.html#goog.json.Replacer">goog.json.Replacer</a>=</code><dd>Replacer.</dl></table></div></div></div></section><div id="visibility-controls"><b>Show:</b><label for="show-public"><span><input type="checkbox" id="show-public" checked/></span>Public</label><label for="show-protected"><span><input type="checkbox" id="show-protected"/></span>Protected</label><label for="show-private"><span><input type="checkbox" id="show-private"/></span>Private</label></div><section id="instance-methods"><h2>Instance Methods</h2><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/json/json.js.src.html#l195">code »</a><span class="member"><a name="serialize">serialize</a> <span class="args">( object )</span> ⇒ <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code></span></div><p>Serializes an object or a value to a JSON string.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>object: <code class="type">*</code><dd>The object to serialize.</dl><tr><th>Returns<tr><td><dl>A JSON string representation of the input.</dl><tr><th>Throws<tr><td><dl><dt><dd>if there are loops in the object graph.</dl></table></div></details></div></div><div class="wrap-details protected"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/json/json.js.src.html#l324">code »</a><span class="member"><a name="serializeArray">serializeArray</a> <span class="args">( arr, sb )</span></span></div><p>Serializes an array to a JSON string</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>arr: <code class="type"><a href="http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></code><dd>The array to serialize.<dt>sb: <code class="type"><a href="http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></code><dd>Array used as a string builder.</dl></table></div></details></div></div><div class="wrap-details protected"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/json/json.js.src.html#l209">code »</a><span class="member"><a name="serializeInternal">serializeInternal</a> <span class="args">( object, sb )</span></span></div><p>Serializes a generic value to a JSON string</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>object: <code class="type">*</code><dd>The object to serialize.<dt>sb: <code class="type"><a href="http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></code><dd>Array used as a string builder.</dl><tr><th>Throws<tr><td><dl><dt><dd>if there are loops in the object graph.</dl></table></div></details></div></div><div class="wrap-details private"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/json/json.js.src.html#l313">code »</a><span class="member"><a name="serializeNumber_">serializeNumber_</a> <span class="args">( n, sb )</span></span></div><p>Serializes a number to a JSON string</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>n: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></code><dd>The number to serialize.<dt>sb: <code class="type"><a href="http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></code><dd>Array used as a string builder.</dl></table></div></details></div></div><div class="wrap-details private"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/json/json.js.src.html#l348">code »</a><span class="member"><a name="serializeObject_">serializeObject_</a> <span class="args">( obj, sb )</span></span></div><p>Serializes an object to a JSON string</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>obj: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></code><dd>The object to serialize.<dt>sb: <code class="type"><a href="http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></code><dd>Array used as a string builder.</dl></table></div></details></div></div><div class="wrap-details private"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/json/json.js.src.html#l284">code »</a><span class="member"><a name="serializeString_">serializeString_</a> <span class="args">( s, sb )</span></span></div><p>Serializes a string to a JSON string</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>s: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code><dd>The string to serialize.<dt>sb: <code class="type"><a href="http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></code><dd>Array used as a string builder.</dl></table></div></details></div></div></section><section id="instance-properties"><h2>Instance Properties</h2><div class="wrap-details private"><div><details><summary><div><a class="source" href="source/lib/goog/json/json.js.src.html#l184">code »</a><span class="member"><a name="replacer_">replacer_</a> : <code class="type">(<a href="namespace_goog_json.html#goog.json.Replacer">goog.json.Replacer</a>|<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Null">null</a>|<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Undefined">undefined</a>)</code></span></div></summary></details></div></div></section><section id="static-properties"><h2>Static Properties</h2><div class="wrap-details private"><div><details><summary><div><a class="source" href="source/lib/goog/json/json.js.src.html#l252">code »</a><span class="member"><a name="goog.json.Serializer.charToJsonCharCache_">goog.json.Serializer.charToJsonCharCache_</a> : <code class="type">!<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></code></span></div><p>Character mappings used internally for goog.string.quote</summary></details></div></div><div class="wrap-details private"><div><details><summary><div><a class="source" href="source/lib/goog/json/json.js.src.html#l274">code »</a><span class="member"><a name="goog.json.Serializer.charsToReplace_">goog.json.Serializer.charsToReplace_</a> : <code class="type">!<a href="http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/RegExp">RegExp</a></code></span></div><p>Regular expression used to match characters that need to be replaced.
|
|
The S60 browser has a bug where unicode characters are not matched by
|
|
regular expressions. The condition below detects such behaviour and
|
|
adjusts the regular expression accordingly.</summary></details></div></div></section></main><nav id="topnav"><div><div id="menubutton"><label for="sidenav-toggle">Menu</label></div><form id="searchbox"><div><input type="search" placeholder="Search" tabindex="1"></div></form></div></nav><nav id="sidenav"><input type="checkbox" id="sidenav-types-ctrl" /><input type="checkbox" id="sidenav-files-ctrl" /><input type="checkbox" id="sidenav-modules-ctrl" /><a id="sidenav-overview"><div><h4>Overview</h4></div></a><div id="sidenav-types"><label for="sidenav-types-ctrl"><h4>Types</h4></label><i>No data</i></div><div id="sidenav-modules"><label for="sidenav-modules-ctrl"><h4>Modules</h4></label><i>No data</i></div><div id="sidenav-files"><label for="sidenav-files-ctrl"><h4>Files</h4></label><i>No data</i></div><a href="license.html"><div><h4>License</h4></div></a></nav><div id="push-footer"></div></div><footer><a href="https://github.com/jleyba/js-dossier">Generated by dossier</a></footer><script src="types.js"></script><script src="dossier.js"></script> |