Class JsonFormat
java.lang.Object
com.google.protobuf.util.JsonFormat
Utility class to convert protobuf messages to/from the ProtoJSON format.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static final classFormat the JSON without indentationstatic classA Parser parses the proto3 JSON format into a protobuf message.private static classprivate static final classA TextGenerator adds indentation when writing formatted text.static classA Printer converts a protobuf message to the proto3 JSON format.private static final classA Printer converts protobuf messages to the proto3 JSON format.private static enum(package private) static interfaceAn interface for JSON formatting that can be used in combination with the omittingInsignificantWhitespace() method.static classA TypeRegistry is used to resolve Any messages in the JSON conversion. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static StringgetTypeName(String typeUrl) static JsonFormat.Parserparser()Creates aJsonFormat.Parserwith default configuration.static JsonFormat.Printerprinter()Creates aJsonFormat.Printerwith default configurations.
-
Field Details
-
logger
-
-
Constructor Details
-
JsonFormat
private JsonFormat()
-
-
Method Details
-
printer
Creates aJsonFormat.Printerwith default configurations. -
parser
Creates aJsonFormat.Parserwith default configuration. -
getTypeName
- Throws:
InvalidProtocolBufferException
-