Classes | Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes | List of all members
com.google.protobuf.TextFormat.Printer Class Reference

Classes

class  MapEntryAdapter
 

Public Member Functions

Printer escapingNonAscii (boolean escapeNonAscii)
 
Printer escapingNonAscii (boolean escapeNonAscii)
 
void print (final MessageOrBuilder message, final Appendable output) throws IOException
 
void print (final MessageOrBuilder message, final Appendable output) throws IOException
 
void print (final UnknownFieldSet fields, final Appendable output) throws IOException
 
void print (final UnknownFieldSet fields, final Appendable output) throws IOException
 
void printField (final FieldDescriptor field, final Object value, final Appendable output) throws IOException
 
void printField (final FieldDescriptor field, final Object value, final Appendable output) throws IOException
 
String printFieldToString (final FieldDescriptor field, final Object value)
 
String printFieldToString (final FieldDescriptor field, final Object value)
 
void printFieldValue (final FieldDescriptor field, final Object value, final Appendable output) throws IOException
 
void printFieldValue (final FieldDescriptor field, final Object value, final Appendable output) throws IOException
 
String printToString (final MessageOrBuilder message)
 
String printToString (final MessageOrBuilder message)
 
String printToString (final UnknownFieldSet fields)
 
String printToString (final UnknownFieldSet fields)
 
String shortDebugString (final FieldDescriptor field, final Object value)
 
String shortDebugString (final FieldDescriptor field, final Object value)
 
String shortDebugString (final MessageOrBuilder message)
 
String shortDebugString (final MessageOrBuilder message)
 
String shortDebugString (final UnknownFieldSet fields)
 
String shortDebugString (final UnknownFieldSet fields)
 
Printer usingTypeRegistry (TypeRegistry typeRegistry)
 
Printer usingTypeRegistry (TypeRegistry typeRegistry)
 

Private Member Functions

void print (final MessageOrBuilder message, final TextGenerator generator) throws IOException
 
void print (final MessageOrBuilder message, final TextGenerator generator) throws IOException
 
boolean printAny (final MessageOrBuilder message, final TextGenerator generator) throws IOException
 
boolean printAny (final MessageOrBuilder message, final TextGenerator generator) throws IOException
 
 Printer (boolean escapeNonAscii, TypeRegistry typeRegistry)
 
 Printer (boolean escapeNonAscii, TypeRegistry typeRegistry)
 
void printField (final FieldDescriptor field, final Object value, final TextGenerator generator) throws IOException
 
void printField (final FieldDescriptor field, final Object value, final TextGenerator generator) throws IOException
 
void printFieldValue (final FieldDescriptor field, final Object value, final TextGenerator generator) throws IOException
 
void printFieldValue (final FieldDescriptor field, final Object value, final TextGenerator generator) throws IOException
 
void printMessage (final MessageOrBuilder message, final TextGenerator generator) throws IOException
 
void printMessage (final MessageOrBuilder message, final TextGenerator generator) throws IOException
 
void printSingleField (final FieldDescriptor field, final Object value, final TextGenerator generator) throws IOException
 
void printSingleField (final FieldDescriptor field, final Object value, final TextGenerator generator) throws IOException
 

Static Private Member Functions

static void printUnknownField (final int number, final int wireType, final List<?> values, final TextGenerator generator) throws IOException
 
static void printUnknownField (final int number, final int wireType, final List<?> values, final TextGenerator generator) throws IOException
 
static void printUnknownFields (final UnknownFieldSet unknownFields, final TextGenerator generator) throws IOException
 
static void printUnknownFields (final UnknownFieldSet unknownFields, final TextGenerator generator) throws IOException
 
static void printUnknownFieldValue (final int tag, final Object value, final TextGenerator generator) throws IOException
 
static void printUnknownFieldValue (final int tag, final Object value, final TextGenerator generator) throws IOException
 

Private Attributes

final boolean escapeNonAscii
 
final TypeRegistry typeRegistry
 

Static Private Attributes

static final Printer DEFAULT = new Printer(true, TypeRegistry.getEmptyTypeRegistry())
 

Detailed Description

Helper class for converting protobufs to text.

Definition at line 287 of file bloaty/third_party/protobuf/java/core/src/main/java/com/google/protobuf/TextFormat.java.

Constructor & Destructor Documentation

◆ Printer() [1/2]

com.google.protobuf.TextFormat.Printer.Printer ( boolean  escapeNonAscii,
TypeRegistry  typeRegistry 
)
inlineprivate

◆ Printer() [2/2]

com.google.protobuf.TextFormat.Printer.Printer ( boolean  escapeNonAscii,
TypeRegistry  typeRegistry 
)
inlineprivate

Member Function Documentation

◆ escapingNonAscii() [1/2]

Printer com.google.protobuf.TextFormat.Printer.escapingNonAscii ( boolean  escapeNonAscii)
inline

Return a new Printer instance with the specified escape mode.

Parameters
escapeNonAsciiIf 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.
Returns
a new Printer that clones all other configurations from the current Printer, with the escape mode set to the given parameter.

Definition at line 311 of file bloaty/third_party/protobuf/java/core/src/main/java/com/google/protobuf/TextFormat.java.

◆ escapingNonAscii() [2/2]

Printer com.google.protobuf.TextFormat.Printer.escapingNonAscii ( boolean  escapeNonAscii)
inline

Return a new Printer instance with the specified escape mode.

Parameters
escapeNonAsciiIf 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.
Returns
a new Printer that clones all other configurations from the current Printer, with the escape mode set to the given parameter.

Definition at line 316 of file protobuf/java/core/src/main/java/com/google/protobuf/TextFormat.java.

◆ print() [1/6]

void com.google.protobuf.TextFormat.Printer.print ( final MessageOrBuilder  message,
final Appendable  output 
) throws IOException
inline

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)

Definition at line 333 of file bloaty/third_party/protobuf/java/core/src/main/java/com/google/protobuf/TextFormat.java.

◆ print() [2/6]

void com.google.protobuf.TextFormat.Printer.print ( final MessageOrBuilder  message,
final Appendable  output 
) throws IOException
inline

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)

Definition at line 338 of file protobuf/java/core/src/main/java/com/google/protobuf/TextFormat.java.

◆ print() [3/6]

void com.google.protobuf.TextFormat.Printer.print ( final MessageOrBuilder  message,
final TextGenerator  generator 
) throws IOException
inlineprivate

◆ print() [4/6]

void com.google.protobuf.TextFormat.Printer.print ( final MessageOrBuilder  message,
final TextGenerator  generator 
) throws IOException
inlineprivate

◆ print() [5/6]

void com.google.protobuf.TextFormat.Printer.print ( final UnknownFieldSet  fields,
final Appendable  output 
) throws IOException
inline

Outputs a textual representation of

to

.

Definition at line 338 of file bloaty/third_party/protobuf/java/core/src/main/java/com/google/protobuf/TextFormat.java.

◆ print() [6/6]

void com.google.protobuf.TextFormat.Printer.print ( final UnknownFieldSet  fields,
final Appendable  output 
) throws IOException
inline

Outputs a textual representation of

to

.

Definition at line 343 of file protobuf/java/core/src/main/java/com/google/protobuf/TextFormat.java.

◆ printAny() [1/2]

boolean com.google.protobuf.TextFormat.Printer.printAny ( final MessageOrBuilder  message,
final TextGenerator  generator 
) throws IOException
inlineprivate

Attempt to print the 'google.protobuf.Any' message in a human-friendly format. Returns false if the message isn't a valid 'google.protobuf.Any' message (in which case the message should be rendered just like a regular message to help debugging).

Definition at line 356 of file bloaty/third_party/protobuf/java/core/src/main/java/com/google/protobuf/TextFormat.java.

◆ printAny() [2/2]

boolean com.google.protobuf.TextFormat.Printer.printAny ( final MessageOrBuilder  message,
final TextGenerator  generator 
) throws IOException
inlineprivate

Attempt to print the 'google.protobuf.Any' message in a human-friendly format. Returns false if the message isn't a valid 'google.protobuf.Any' message (in which case the message should be rendered just like a regular message to help debugging).

Definition at line 361 of file protobuf/java/core/src/main/java/com/google/protobuf/TextFormat.java.

◆ printField() [1/4]

void com.google.protobuf.TextFormat.Printer.printField ( final FieldDescriptor  field,
final Object  value,
final Appendable  output 
) throws IOException
inline

◆ printField() [2/4]

void com.google.protobuf.TextFormat.Printer.printField ( final FieldDescriptor  field,
final Object  value,
final Appendable  output 
) throws IOException
inline

◆ printField() [3/4]

void com.google.protobuf.TextFormat.Printer.printField ( final FieldDescriptor  field,
final Object  value,
final TextGenerator  generator 
) throws IOException
inlineprivate

◆ printField() [4/4]

void com.google.protobuf.TextFormat.Printer.printField ( final FieldDescriptor  field,
final Object  value,
final TextGenerator  generator 
) throws IOException
inlineprivate

◆ printFieldToString() [1/2]

String com.google.protobuf.TextFormat.Printer.printFieldToString ( final FieldDescriptor  field,
final Object  value 
)
inline

◆ printFieldToString() [2/2]

String com.google.protobuf.TextFormat.Printer.printFieldToString ( final FieldDescriptor  field,
final Object  value 
)
inline

◆ printFieldValue() [1/4]

void com.google.protobuf.TextFormat.Printer.printFieldValue ( final FieldDescriptor  field,
final Object  value,
final Appendable  output 
) throws IOException
inline

Outputs a textual representation of the value of given field value.

Parameters
fieldthe descriptor of the field
valuethe value of the field
outputthe output to which to append the formatted value
Exceptions
ClassCastExceptionif the value is not appropriate for the given field descriptor
IOExceptionif there is an exception writing to the output

Definition at line 441 of file bloaty/third_party/protobuf/java/core/src/main/java/com/google/protobuf/TextFormat.java.

◆ printFieldValue() [2/4]

void com.google.protobuf.TextFormat.Printer.printFieldValue ( final FieldDescriptor  field,
final Object  value,
final Appendable  output 
) throws IOException
inline

Outputs a textual representation of the value of given field value.

Parameters
fieldthe descriptor of the field
valuethe value of the field
outputthe output to which to append the formatted value
Exceptions
ClassCastExceptionif the value is not appropriate for the given field descriptor
IOExceptionif there is an exception writing to the output

Definition at line 526 of file protobuf/java/core/src/main/java/com/google/protobuf/TextFormat.java.

◆ printFieldValue() [3/4]

void com.google.protobuf.TextFormat.Printer.printFieldValue ( final FieldDescriptor  field,
final Object  value,
final TextGenerator  generator 
) throws IOException
inlineprivate

◆ printFieldValue() [4/4]

void com.google.protobuf.TextFormat.Printer.printFieldValue ( final FieldDescriptor  field,
final Object  value,
final TextGenerator  generator 
) throws IOException
inlineprivate

◆ printMessage() [1/2]

void com.google.protobuf.TextFormat.Printer.printMessage ( final MessageOrBuilder  message,
final TextGenerator  generator 
) throws IOException
inlineprivate

◆ printMessage() [2/2]

void com.google.protobuf.TextFormat.Printer.printMessage ( final MessageOrBuilder  message,
final TextGenerator  generator 
) throws IOException
inlineprivate

◆ printSingleField() [1/2]

void com.google.protobuf.TextFormat.Printer.printSingleField ( final FieldDescriptor  field,
final Object  value,
final TextGenerator  generator 
) throws IOException
inlineprivate

◆ printSingleField() [2/2]

void com.google.protobuf.TextFormat.Printer.printSingleField ( final FieldDescriptor  field,
final Object  value,
final TextGenerator  generator 
) throws IOException
inlineprivate

◆ printToString() [1/4]

String com.google.protobuf.TextFormat.Printer.printToString ( final MessageOrBuilder  message)
inline

Like

, but writes directly to a

String

and returns it.

Definition at line 516 of file bloaty/third_party/protobuf/java/core/src/main/java/com/google/protobuf/TextFormat.java.

◆ printToString() [2/4]

String com.google.protobuf.TextFormat.Printer.printToString ( final MessageOrBuilder  message)
inline

Like

, but writes directly to a

String

and returns it.

Definition at line 601 of file protobuf/java/core/src/main/java/com/google/protobuf/TextFormat.java.

◆ printToString() [3/4]

String com.google.protobuf.TextFormat.Printer.printToString ( final UnknownFieldSet  fields)
inline

Like

, but writes directly to a

String

and returns it.

Definition at line 526 of file bloaty/third_party/protobuf/java/core/src/main/java/com/google/protobuf/TextFormat.java.

◆ printToString() [4/4]

String com.google.protobuf.TextFormat.Printer.printToString ( final UnknownFieldSet  fields)
inline

Like

, but writes directly to a

String

and returns it.

Definition at line 611 of file protobuf/java/core/src/main/java/com/google/protobuf/TextFormat.java.

◆ printUnknownField() [1/2]

static void com.google.protobuf.TextFormat.Printer.printUnknownField ( final int  number,
final int  wireType,
final List<?>  values,
final TextGenerator  generator 
) throws IOException
inlinestaticprivate

◆ printUnknownField() [2/2]

static void com.google.protobuf.TextFormat.Printer.printUnknownField ( final int  number,
final int  wireType,
final List<?>  values,
final TextGenerator  generator 
) throws IOException
inlinestaticprivate

◆ printUnknownFields() [1/2]

static void com.google.protobuf.TextFormat.Printer.printUnknownFields ( final UnknownFieldSet  unknownFields,
final TextGenerator  generator 
) throws IOException
inlinestaticprivate

◆ printUnknownFields() [2/2]

static void com.google.protobuf.TextFormat.Printer.printUnknownFields ( final UnknownFieldSet  unknownFields,
final TextGenerator  generator 
) throws IOException
inlinestaticprivate

◆ printUnknownFieldValue() [1/2]

static void com.google.protobuf.TextFormat.Printer.printUnknownFieldValue ( final int  tag,
final Object  value,
final TextGenerator  generator 
) throws IOException
inlinestaticprivate

◆ printUnknownFieldValue() [2/2]

static void com.google.protobuf.TextFormat.Printer.printUnknownFieldValue ( final int  tag,
final Object  value,
final TextGenerator  generator 
) throws IOException
inlinestaticprivate

◆ shortDebugString() [1/6]

String com.google.protobuf.TextFormat.Printer.shortDebugString ( final FieldDescriptor  field,
final Object  value 
)
inline

Generates a human readable form of the field, useful for debugging and other purposes, with no newline characters.

Definition at line 554 of file bloaty/third_party/protobuf/java/core/src/main/java/com/google/protobuf/TextFormat.java.

◆ shortDebugString() [2/6]

String com.google.protobuf.TextFormat.Printer.shortDebugString ( final FieldDescriptor  field,
final Object  value 
)
inline

Generates a human readable form of the field, useful for debugging and other purposes, with no newline characters.

Definition at line 639 of file protobuf/java/core/src/main/java/com/google/protobuf/TextFormat.java.

◆ shortDebugString() [3/6]

String com.google.protobuf.TextFormat.Printer.shortDebugString ( final MessageOrBuilder  message)
inline

Generates a human readable form of this message, useful for debugging and other purposes, with no newline characters.

Definition at line 540 of file bloaty/third_party/protobuf/java/core/src/main/java/com/google/protobuf/TextFormat.java.

◆ shortDebugString() [4/6]

String com.google.protobuf.TextFormat.Printer.shortDebugString ( final MessageOrBuilder  message)
inline

Generates a human readable form of this message, useful for debugging and other purposes, with no newline characters.

Definition at line 625 of file protobuf/java/core/src/main/java/com/google/protobuf/TextFormat.java.

◆ shortDebugString() [5/6]

String com.google.protobuf.TextFormat.Printer.shortDebugString ( final UnknownFieldSet  fields)
inline

Generates a human readable form of the unknown fields, useful for debugging and other purposes, with no newline characters.

Definition at line 568 of file bloaty/third_party/protobuf/java/core/src/main/java/com/google/protobuf/TextFormat.java.

◆ shortDebugString() [6/6]

String com.google.protobuf.TextFormat.Printer.shortDebugString ( final UnknownFieldSet  fields)
inline

Generates a human readable form of the unknown fields, useful for debugging and other purposes, with no newline characters.

Definition at line 653 of file protobuf/java/core/src/main/java/com/google/protobuf/TextFormat.java.

◆ usingTypeRegistry() [1/2]

Printer com.google.protobuf.TextFormat.Printer.usingTypeRegistry ( TypeRegistry  typeRegistry)
inline

Creates a new Printer using the given typeRegistry. The new Printer clones all other configurations from the current Printer.

Exceptions
IllegalArgumentExceptionif a registry is already set.

Definition at line 321 of file bloaty/third_party/protobuf/java/core/src/main/java/com/google/protobuf/TextFormat.java.

◆ usingTypeRegistry() [2/2]

Printer com.google.protobuf.TextFormat.Printer.usingTypeRegistry ( TypeRegistry  typeRegistry)
inline

Creates a new Printer using the given typeRegistry. The new Printer clones all other configurations from the current Printer.

Exceptions
IllegalArgumentExceptionif a registry is already set.

Definition at line 326 of file protobuf/java/core/src/main/java/com/google/protobuf/TextFormat.java.

Member Data Documentation

◆ DEFAULT

static final Printer com.google.protobuf.TextFormat.Printer.DEFAULT = new Printer(true, TypeRegistry.getEmptyTypeRegistry())
staticprivate

◆ escapeNonAscii

final boolean com.google.protobuf.TextFormat.Printer.escapeNonAscii
private

Whether to escape non ASCII characters with backslash and octal.

Definition at line 293 of file bloaty/third_party/protobuf/java/core/src/main/java/com/google/protobuf/TextFormat.java.

◆ typeRegistry

final TypeRegistry com.google.protobuf.TextFormat.Printer.typeRegistry
private

The documentation for this class was generated from the following file:
com.google.protobuf.TextFormat.Printer.print
void print(final MessageOrBuilder message, final Appendable output)
Definition: bloaty/third_party/protobuf/java/core/src/main/java/com/google/protobuf/TextFormat.java:333
gmock_output_test.output
output
Definition: bloaty/third_party/googletest/googlemock/test/gmock_output_test.py:175
profile_analyzer.fields
list fields
Definition: profile_analyzer.py:266


grpc
Author(s):
autogenerated on Fri May 16 2025 03:03:07