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.)
Constructors and Destructors |
|
---|---|
JsonParser(Settings settings)
Creates a new formatted with the given settings.
|
Properties |
|
---|---|
Default
|
Returns a formatter using the default settings.
|
Public functions |
|
---|---|
Parse(string json, MessageDescriptor descriptor)
|
Parses json into a new message.
|
Parse(TextReader jsonReader, MessageDescriptor descriptor)
|
Parses JSON read from jsonReader into a new message.
|
Parse< T >(string json)
|
T
Parses json into a new message.
|
Parse< T >(TextReader jsonReader)
|
T
Parses JSON read from jsonReader into a new message.
|
Classes |
|
---|---|
Google. |
Settings controlling JSON parsing. |
JsonParser( Settings settings )
Creates a new formatted with the given settings.
Details | |||
---|---|---|---|
Parameters |
|
IMessage Parse( string json, MessageDescriptor descriptor )
Parses json into a new message.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Exceptions |
|
IMessage Parse( TextReader jsonReader, MessageDescriptor descriptor )
Parses JSON read from jsonReader into a new message.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Exceptions |
|
T Parse< T >( string json )
Parses json into a new message.
Details | |||||
---|---|---|---|---|---|
Template Parameters |
|
||||
Parameters |
|
||||
Exceptions |
|
T Parse< T >( TextReader jsonReader )
Parses JSON read from jsonReader into a new message.
Details | |||||
---|---|---|---|---|---|
Template Parameters |
|
||||
Parameters |
|
||||
Exceptions |
|