public class JsonFormat
Utility classes to convert protobuf messages to/from JSON format. The JSON format follows Proto3 JSON specification and only proto3 features are supported. Proto2 only features (e.g., extensions and unknown fields) will be discarded in the conversion. That is, when converting proto2 messages to JSON format, extensions and unknown fields will be treated as if they do not exist. This applies to proto2 messages embedded in proto3 messages as well.
Static Methods
parser()
public static JsonFormat.Parser parser()
Creates a Parser with default configuration.
Returns | |
---|---|
Type | Description |
JsonFormat.Parser |
printer()
public static JsonFormat.Printer printer()
Creates a Printer with default configurations.
Returns | |
---|---|
Type | Description |
JsonFormat.Printer |