Property | Type | Description | |
---|---|---|---|
CanWriteSingleValue | bool | ||
HexEncodeUtf16CodeUnit | void | ||
IsDefaultValue | bool | ||
JsonFormatter | System | ||
ToCamelCase | string | ||
ToCamelCaseForFieldMask | string | ||
WriteAny | void | ||
WriteDiagnosticOnlyAny | void | ||
WriteDictionary | void | ||
WriteDuration | void | ||
WriteFieldMask | void | ||
WriteList | void | ||
WriteMessage | void | ||
WriteMessageFields | bool | ||
WriteNull | void | ||
WriteString | void | ||
WriteStruct | void | ||
WriteStructFieldValue | void | ||
WriteTimestamp | void | ||
WriteValue | void | ||
WriteWellKnownTypeValue | void |
Method | Description | |
---|---|---|
Format ( IMessage message ) : string |
Formats the specified message as JSON.
|
|
Format ( IMessage message, |
Formats the specified message as JSON.
|
|
JsonFormatter ( Settings settings ) : System |
Creates a new formatted with the given settings.
|
|
ToDiagnosticString ( IMessage message ) : string |
Converts a message to JSON for diagnostic purposes with no extra context. This differs from calling Format(IMessage) on the default JSON formatter in its handling of Any. As no type registry is available in object.ToString calls, the normal way of resolving the type of an The value returned by this method is only designed to be used for diagnostic purposes. It may not be parsable by JsonParser, and may not be parsable by other Protocol Buffer implementations. |
Method | Description | |
---|---|---|
CanWriteSingleValue ( object value ) : bool |
Returns whether or not a singular value can be represented in JSON. Currently only relevant for enums, where unknown values can't be represented. For repeated/map fields, this always returns true.
|
|
HexEncodeUtf16CodeUnit ( |
||
IsDefaultValue ( IFieldAccessor accessor, object value ) : bool | ||
JsonFormatter ( ) : System | ||
ToCamelCase ( string input ) : string | ||
ToCamelCaseForFieldMask ( string input ) : string |
Camel-case converter with added strictness for field mask formatting.
|
|
WriteAny ( |
||
WriteDiagnosticOnlyAny ( |
||
WriteDictionary ( |
||
WriteDuration ( |
||
WriteFieldMask ( |
||
WriteList ( |
||
WriteMessage ( |
||
WriteMessageFields ( |
||
WriteNull ( |
||
WriteString ( |
Writes a string (including leading and trailing double quotes) to a builder, escaping as required. Other than surrogate pair handling, this code is mostly taken from src/google/protobuf/util/internal/json_escaping.cc. |
|
WriteStruct ( |
||
WriteStructFieldValue ( |
||
WriteTimestamp ( |
||
WriteValue ( |
||
WriteWellKnownTypeValue ( |
Central interception point for well-known type formatting. Any well-known types which don't need special handling can fall back to WriteMessage. We avoid assuming that the values are using the embedded well-known types, in order to allow for dynamic messages in the future.
|
public Format ( IMessage message ) : string | ||
message | IMessage | The message to format. |
return | string |
public Format ( IMessage message, |
||
message | IMessage | The message to format. |
writer | The TextWriter to write the formatted message to. | |
return | void |
public JsonFormatter ( Settings settings ) : System | ||
settings | Settings | The settings. |
return | System |
public static ToDiagnosticString ( IMessage message ) : string | ||
message | IMessage | The message to format for diagnostic purposes. |
return | string |