Package com.google.protobuf
Class TextFormatEscaper
- java.lang.Object
-
- com.google.protobuf.TextFormatEscaper
-
final class TextFormatEscaper extends java.lang.Object
Provide text format escaping support for proto2 instances.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static interface
TextFormatEscaper.ByteSequence
-
Constructor Summary
Constructors Modifier Constructor Description private
TextFormatEscaper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description (package private) static java.lang.String
escapeBytes(byte[] input)
LikeescapeBytes(ByteString)
, but used for byte array.(package private) static java.lang.String
escapeBytes(ByteString input)
Escapes bytes in the format used in protocol buffer text format, which is the same as the format used for C string literals.(package private) static java.lang.String
escapeBytes(TextFormatEscaper.ByteSequence input)
Escapes bytes in the format used in protocol buffer text format, which is the same as the format used for C string literals.(package private) static java.lang.String
escapeDoubleQuotesAndBackslashes(java.lang.String input)
Escape double quotes and backslashes in a String for unicode output of a message.(package private) static java.lang.String
escapeText(java.lang.String input)
LikeescapeBytes(ByteString)
, but escapes a text string.
-
-
-
Method Detail
-
escapeBytes
static java.lang.String escapeBytes(TextFormatEscaper.ByteSequence input)
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
static java.lang.String escapeBytes(ByteString input)
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
static java.lang.String escapeBytes(byte[] input)
LikeescapeBytes(ByteString)
, but used for byte array.
-
escapeText
static java.lang.String escapeText(java.lang.String input)
LikeescapeBytes(ByteString)
, but escapes a text string. Non-ASCII characters are first encoded as UTF-8, then each byte is escaped individually as a 3-digit octal escape. Yes, it's weird.
-
escapeDoubleQuotesAndBackslashes
static java.lang.String escapeDoubleQuotesAndBackslashes(java.lang.String input)
Escape double quotes and backslashes in a String for unicode output of a message.
-
-