goog.json
Namespacegoog.json.EvalJsonProcessor
ClassA class that parses and stringifies JSON using eval (as implemented in goog.json). Adapts {@code goog.json} to the {@code goog.json.Processor} interface. … more
goog.json.NativeJsonProcessor
ClassA class that parses and stringifies JSON using the browser's built-in JSON library, if it is avaliable. Note that the native JSON api has subtle differences across browsers, so use this implementation with care. See json_test#assertSerialize for details on the differences from goog.json. This implementation is signficantly faster than goog.json, at least on Chrome. See json_perf.html for a perf test showing the difference. … more
goog.json.Processor
InterfaceAn interface for JSON parsing and serialization. @interface … more
.Replacer
JSON replacer, as defined in Section 15.12.3 of the ES5 spec. TODO(nicksantos): Array should also be a valid replacer.
.Reviver
JSON reviver, as defined in Section 15.12.2 of the ES5 spec.
goog.json.Serializer
ClassClass that is used to serialize JSON objects to a string. … more
.parse(s)
Parses a JSON string and returns the result. This throws an exception if the string is an invalid JSON string. Note that this is very slow on large strings. If you trust the source of the string then you should use unsafeParse instead.
s
{*}
Object
}
.serialize(object, opt_replacer)
Serializes an object or a value to a JSON string.
object
{*}
opt_replacer
{?goog.json.Replacer
=}
string
}
.unsafeParse(s)
Parses a JSON string and returns the result. This uses eval so it is open to security issues and it should only be used if you trust the source.
s
{string
}
Object
}