Stay organized with collectionsSave and categorize content based on your preferences.
publicclassJsonFormat
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.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[],[],null,["# Class JsonFormat (3.19.4)\n\n public class JsonFormat\n\nUtility classes to convert protobuf messages to/from JSON format. The JSON\nformat follows Proto3 JSON specification and only proto3 features are\nsupported. Proto2 only features (e.g., extensions and unknown fields) will\nbe discarded in the conversion. That is, when converting proto2 messages\nto JSON format, extensions and unknown fields will be treated as if they\ndo not exist. This applies to proto2 messages embedded in proto3 messages\nas well. \n\nInheritance\n-----------\n\n[java.lang.Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html) \\\u003e JsonFormat \n\nInherited Members\n-----------------\n\n[Object.clone()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#clone--) \n[Object.equals(Object)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals-java.lang.Object-) \n[Object.finalize()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#finalize--) \n[Object.getClass()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass--) \n[Object.hashCode()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode--) \n[Object.notify()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify--) \n[Object.notifyAll()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll--) \n[Object.toString()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString--) \n[Object.wait()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait--) \n[Object.wait(long)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-) \n[Object.wait(long,int)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-int-)\n\nStatic Methods\n--------------\n\n### parser()\n\n public static JsonFormat.Parser parser()\n\nCreates a [Parser](/java/docs/reference/protobuf/latest/com.google.protobuf.Parser) with default configuration.\n\n### printer()\n\n public static JsonFormat.Printer printer()\n\nCreates a Printer with default configurations."]]