|
webkit
2cdf99a9e3038c7e01b3c37e8ad903ecbe5eecf1
https://github.com/WebKit/webkit
|
Reflection-based converter from JSON to messages. More...
Classes | |
| class | Settings |
| Settings controlling JSON parsing. More... | |
Public Member Functions | |
| JsonParser (Settings settings) | |
| Creates a new formatted with the given settings. More... | |
| T | Parse< T > (string json) |
| Parses json into a new message. More... | |
| T | Parse< T > (TextReader jsonReader) |
| Parses JSON read from jsonReader into a new message. More... | |
| IMessage | Parse (string json, MessageDescriptor descriptor) |
| Parses json into a new message. More... | |
| IMessage | Parse (TextReader jsonReader, MessageDescriptor descriptor) |
| Parses JSON read from jsonReader into a new message. More... | |
Properties | |
| static JsonParser | Default [get] |
| Returns a formatter using the default settings. More... | |
Reflection-based converter from JSON to messages.
Instances of this class are thread-safe, with no mutable state.
This is a simple start to get JSON parsing working. As it's reflection-based, it's not as quick as baking calls into generated messages - but is a simpler implementation. (This code is generally not heavily optimized.)
|
inline |
Creates a new formatted with the given settings.
| settings | The settings. |
|
inline |
Parses json into a new message.
| json | The JSON to parse. |
| descriptor | Descriptor of message type to parse. |
| InvalidJsonException | The JSON does not comply with RFC 7159 |
| InvalidProtocolBufferException | The JSON does not represent a Protocol Buffers message correctly |
|
inline |
Parses JSON read from jsonReader into a new message.
| jsonReader | Reader providing the JSON to parse. |
| descriptor | Descriptor of message type to parse. |
| InvalidJsonException | The JSON does not comply with RFC 7159 |
| InvalidProtocolBufferException | The JSON does not represent a Protocol Buffers message correctly |
|
inline |
Parses json into a new message.
| T | The type of message to create. |
| json | The JSON to parse. |
| InvalidJsonException | The JSON does not comply with RFC 7159 |
| InvalidProtocolBufferException | The JSON does not represent a Protocol Buffers message correctly |
| T | : | IMessage | |
| T | : | new() |
|
inline |
Parses JSON read from jsonReader into a new message.
| T | The type of message to create. |
| jsonReader | Reader providing the JSON to parse. |
| InvalidJsonException | The JSON does not comply with RFC 7159 |
| InvalidProtocolBufferException | The JSON does not represent a Protocol Buffers message correctly |
| T | : | IMessage | |
| T | : | new() |
|
staticget |
Returns a formatter using the default settings.
1.8.13