Package com.google.protobuf.util
Class JsonFormat
- java.lang.Object
-
- com.google.protobuf.util.JsonFormat
-
public class JsonFormat extends java.lang.ObjectUtility class to convert protobuf messages to/from the Proto3 JSON format. Only proto3 features are supported. Proto2 only features such as extensions and unknown fields are discarded in the conversion. That is, when converting proto2 messages to JSON format, extensions and unknown fields are treated as if they do not exist. This applies to proto2 messages embedded in proto3 messages as well.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classJsonFormat.ParserA Parser parses the proto3 JSON format into a protobuf message.static classJsonFormat.PrinterA Printer converts a protobuf message to the proto3 JSON format.static classJsonFormat.TypeRegistryA TypeRegistry is used to resolve Any messages in the JSON conversion.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static JsonFormat.Parserparser()Creates aJsonFormat.Parserwith default configuration.static JsonFormat.Printerprinter()Creates aJsonFormat.Printerwith default configurations.
-
-
-
Method Detail
-
printer
public static JsonFormat.Printer printer()
Creates aJsonFormat.Printerwith default configurations.
-
parser
public static JsonFormat.Parser parser()
Creates aJsonFormat.Parserwith default configuration.
-
-