webkit  2cdf99a9e3038c7e01b3c37e8ad903ecbe5eecf1
https://github.com/WebKit/webkit
Classes | Static Public Member Functions | List of all members
com.google.protobuf.TextFormat Class Reference

Classes

class  InvalidEscapeSequenceException
 
class  ParseException
 
class  Parser
 
class  UnknownFieldParseException
 

Static Public Member Functions

static void print (final MessageOrBuilder message, final Appendable output) throws IOException
 
static void print (final UnknownFieldSet fields, final Appendable output) throws IOException
 
static void printUnicode (final MessageOrBuilder message, final Appendable output) throws IOException
 
static void printUnicode (final UnknownFieldSet fields, final Appendable output) throws IOException
 
static String shortDebugString (final MessageOrBuilder message)
 
static String shortDebugString (final FieldDescriptor field, final Object value)
 
static String shortDebugString (final UnknownFieldSet fields)
 
static String printToString (final MessageOrBuilder message)
 
static String printToString (final UnknownFieldSet fields)
 
static String printToUnicodeString (final MessageOrBuilder message)
 
static String printToUnicodeString (final UnknownFieldSet fields)
 
static void printField (final FieldDescriptor field, final Object value, final Appendable output) throws IOException
 
static String printFieldToString (final FieldDescriptor field, final Object value)
 
static void printFieldValue (final FieldDescriptor field, final Object value, final Appendable output) throws IOException
 
static void printUnknownFieldValue (final int tag, final Object value, final Appendable output) throws IOException
 
static String unsignedToString (final int value)
 
static String unsignedToString (final long value)
 
static Parser getParser ()
 
static void merge (final Readable input, final Message.Builder builder) throws IOException
 
static void merge (final CharSequence input, final Message.Builder builder) throws ParseException
 
static void merge (final Readable input, final ExtensionRegistry extensionRegistry, final Message.Builder builder) throws IOException
 
static void merge (final CharSequence input, final ExtensionRegistry extensionRegistry, final Message.Builder builder) throws ParseException
 
static String escapeBytes (ByteString input)
 
static String escapeBytes (byte[] input)
 
static ByteString unescapeBytes (final CharSequence charString) throws InvalidEscapeSequenceException
 
static String escapeDoubleQuotesAndBackslashes (final String input)
 

Detailed Description

Provide text parsing and formatting support for proto2 instances. The implementation largely follows google/protobuf/text_format.cc.

Author
wenbo.nosp@m.z@go.nosp@m.ogle..nosp@m.com Wenbo Zhu
kento.nosp@m.n@go.nosp@m.ogle..nosp@m.com Kenton Varda

Member Function Documentation

◆ escapeBytes() [1/2]

static String com.google.protobuf.TextFormat.escapeBytes ( ByteString  input)
inlinestatic

Escapes bytes in the format used in protocol buffer text format, which is the same as the format used for C string literals. All bytes that are not printable 7-bit ASCII characters are escaped, as well as backslash, single-quote, and double-quote characters. Characters for which no defined short-hand escape sequence is defined will be escaped using 3-digit octal sequences.

◆ escapeBytes() [2/2]

static String com.google.protobuf.TextFormat.escapeBytes ( byte []  input)
inlinestatic

Like escapeBytes(ByteString), but used for byte array.

◆ escapeDoubleQuotesAndBackslashes()

static String com.google.protobuf.TextFormat.escapeDoubleQuotesAndBackslashes ( final String  input)
inlinestatic

Escape double quotes and backslashes in a String for unicode output of a message.

◆ getParser()

static Parser com.google.protobuf.TextFormat.getParser ( )
inlinestatic

Return a Parser instance which can parse text-format messages. The returned instance is thread-safe.

◆ merge() [1/4]

static void com.google.protobuf.TextFormat.merge ( final Readable  input,
final Message.Builder  builder 
) throws IOException
inlinestatic

Parse a text-format message from

and merge the contents into

builder

.

◆ merge() [2/4]

static void com.google.protobuf.TextFormat.merge ( final CharSequence  input,
final Message.Builder  builder 
) throws ParseException
inlinestatic

Parse a text-format message from

and merge the contents into

builder

.

◆ merge() [3/4]

static void com.google.protobuf.TextFormat.merge ( final Readable  input,
final ExtensionRegistry  extensionRegistry,
final Message.Builder  builder 
) throws IOException
inlinestatic

Parse a text-format message from

and merge the contents into

builder

. Extensions will be recognized if they are registered in

extensionRegistry

.

◆ merge() [4/4]

static void com.google.protobuf.TextFormat.merge ( final CharSequence  input,
final ExtensionRegistry  extensionRegistry,
final Message.Builder  builder 
) throws ParseException
inlinestatic

Parse a text-format message from

and merge the contents into

builder

. Extensions will be recognized if they are registered in

extensionRegistry

.

◆ print() [1/2]

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

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)

◆ print() [2/2]

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

Outputs a textual representation of

fields

to

.

◆ printField()

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

◆ printFieldToString()

static String com.google.protobuf.TextFormat.printFieldToString ( final FieldDescriptor  field,
final Object  value 
)
inlinestatic

◆ printFieldValue()

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

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

◆ printToString() [1/2]

static String com.google.protobuf.TextFormat.printToString ( final MessageOrBuilder  message)
inlinestatic

Like

, but writes directly to a

and returns it.

◆ printToString() [2/2]

static String com.google.protobuf.TextFormat.printToString ( final UnknownFieldSet  fields)
inlinestatic

Like

, but writes directly to a

and returns it.

◆ printToUnicodeString() [1/2]

static String com.google.protobuf.TextFormat.printToUnicodeString ( final MessageOrBuilder  message)
inlinestatic

Same as

, except that non-ASCII characters in string type fields are not escaped in backslash+octals.

◆ printToUnicodeString() [2/2]

static String com.google.protobuf.TextFormat.printToUnicodeString ( final UnknownFieldSet  fields)
inlinestatic

Same as

, except that non-ASCII characters in string type fields are not escaped in backslash+octals.

◆ printUnicode() [1/2]

static void com.google.protobuf.TextFormat.printUnicode ( final MessageOrBuilder  message,
final Appendable  output 
) throws IOException
inlinestatic

Same as

, except that non-ASCII characters are not escaped.

◆ printUnicode() [2/2]

static void com.google.protobuf.TextFormat.printUnicode ( final UnknownFieldSet  fields,
final Appendable  output 
) throws IOException
inlinestatic

Same as

, except that non-ASCII characters are not escaped.

◆ printUnknownFieldValue()

static void com.google.protobuf.TextFormat.printUnknownFieldValue ( final int  tag,
final Object  value,
final Appendable  output 
) throws IOException
inlinestatic

Outputs a textual representation of the value of an unknown field.

Parameters
tagthe field's tag number
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

◆ shortDebugString() [1/3]

static String com.google.protobuf.TextFormat.shortDebugString ( final MessageOrBuilder  message)
inlinestatic

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

◆ shortDebugString() [2/3]

static String com.google.protobuf.TextFormat.shortDebugString ( final FieldDescriptor  field,
final Object  value 
)
inlinestatic

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

◆ shortDebugString() [3/3]

static String com.google.protobuf.TextFormat.shortDebugString ( final UnknownFieldSet  fields)
inlinestatic

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

◆ unescapeBytes()

static ByteString com.google.protobuf.TextFormat.unescapeBytes ( final CharSequence  charString) throws InvalidEscapeSequenceException
inlinestatic

Un-escape a byte sequence as escaped using escapeBytes(ByteString). Two-digit hex escapes (starting with "\x") are also recognized.

◆ unsignedToString() [1/2]

static String com.google.protobuf.TextFormat.unsignedToString ( final int  value)
inlinestatic

Convert an unsigned 32-bit integer to a string.

◆ unsignedToString() [2/2]

static String com.google.protobuf.TextFormat.unsignedToString ( final long  value)
inlinestatic

Convert an unsigned 64-bit integer to a string.


The documentation for this class was generated from the following file: