If true, the new Printer will escape non-ASCII characters (this is the
default behavior. If false, the new Printer will print non-ASCII characters as is. In
either case, the new Printer still escapes newlines and quotes in strings.
Outputs a textual representation of the Protocol Message supplied into the parameter output.
(This representation is the new version of the classic "ProtocolPrinter" output from the
original Protocol Buffer system)
[[["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-08-28 UTC."],[],[],null,["# Class TextFormat.Printer (3.19.4)\n\n public static final class TextFormat.Printer\n\nHelper class for converting protobufs to text. \n\nInheritance\n-----------\n\n[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html) \\\u003e TextFormat.Printer \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\nMethods\n-------\n\n### escapingNonAscii(boolean escapeNonAscii)\n\n public TextFormat.Printer escapingNonAscii(boolean escapeNonAscii)\n\nReturn a new Printer instance with the specified escape mode.\n\n### print(MessageOrBuilder message, Appendable output)\n\n public void print(MessageOrBuilder message, Appendable output)\n\nOutputs a textual representation of the Protocol Message supplied into the parameter output.\n(This representation is the new version of the classic \"ProtocolPrinter\" output from the\noriginal Protocol Buffer system)\n\n### print(UnknownFieldSet fields, Appendable output)\n\n public void print(UnknownFieldSet fields, Appendable output)\n\nOutputs a textual representation of `fields` to `output`.\n\n### printField(Descriptors.FieldDescriptor field, Object value, Appendable output)\n\n public void printField(Descriptors.FieldDescriptor field, Object value, Appendable output)\n\n### printFieldToString(Descriptors.FieldDescriptor field, Object value)\n\n public String printFieldToString(Descriptors.FieldDescriptor field, Object value)\n\n### printFieldValue(Descriptors.FieldDescriptor field, Object value, Appendable output)\n\n public void printFieldValue(Descriptors.FieldDescriptor field, Object value, Appendable output)\n\nOutputs a textual representation of the value of given field value.\n\n### printToString(MessageOrBuilder message)\n\n public String printToString(MessageOrBuilder message)\n\nLike `print()`, but writes directly to a `String` and returns it.\n\n### printToString(UnknownFieldSet fields)\n\n public String printToString(UnknownFieldSet fields)\n\nLike `print()`, but writes directly to a `String` and returns it.\n\n### shortDebugString(Descriptors.FieldDescriptor field, Object value)\n\n public String shortDebugString(Descriptors.FieldDescriptor field, Object value)\n\nGenerates a human readable form of the field, useful for debugging and other purposes, with\nno newline characters.\n\n### shortDebugString(MessageOrBuilder message)\n\n public String shortDebugString(MessageOrBuilder message)\n\nGenerates a human readable form of this message, useful for debugging and other purposes,\nwith no newline characters.\n\n### shortDebugString(UnknownFieldSet fields)\n\n public String shortDebugString(UnknownFieldSet fields)\n\nGenerates a human readable form of the unknown fields, useful for debugging and other\npurposes, with no newline characters.\n\n### usingTypeRegistry(TypeRegistry typeRegistry)\n\n public TextFormat.Printer usingTypeRegistry(TypeRegistry typeRegistry)\n\nCreates a new Printer using the given typeRegistry. The new Printer clones all other\nconfigurations from the current Printer."]]