Classes | |
class | InvalidEscapeSequenceException |
class | ParseException |
class | Parser |
class | Printer |
class | TextGenerator |
class | Tokenizer |
class | UnknownFieldParseException |
Static Public Member Functions | |
static String | escapeBytes (byte[] input) |
static String | escapeBytes (ByteString input) |
static String | escapeDoubleQuotesAndBackslashes (final String input) |
static Parser | getParser () |
static void | merge (final CharSequence input, final ExtensionRegistry extensionRegistry, final Message.Builder builder) throws ParseException |
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 Readable input, final Message.Builder builder) throws IOException |
static< T extends Message > T | parse (final CharSequence input, final Class< T > protoClass) throws ParseException |
static< T extends Message > T | parse (final CharSequence input, final ExtensionRegistry extensionRegistry, final Class< T > protoClass) throws ParseException |
static void | print (final MessageOrBuilder message, final Appendable output) throws IOException |
static void | print (final UnknownFieldSet fields, final Appendable output) throws IOException |
static Printer | printer () |
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 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 | printUnicode (final MessageOrBuilder message, final Appendable output) throws IOException |
static void | printUnicode (final UnknownFieldSet fields, final Appendable output) throws IOException |
static void | printUnicodeFieldValue (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 | shortDebugString (final FieldDescriptor field, final Object value) |
static String | shortDebugString (final MessageOrBuilder message) |
static String | shortDebugString (final UnknownFieldSet fields) |
static ByteString | unescapeBytes (final CharSequence charString) throws InvalidEscapeSequenceException |
static String | unsignedToString (final int value) |
static String | unsignedToString (final long value) |
Private Member Functions | |
TextFormat () | |
Static Private Member Functions | |
static int | digitValue (final byte c) |
static boolean | isHex (final byte c) |
static boolean | isOctal (final byte c) |
static TextGenerator | multiLineOutput (Appendable output) |
static long | parseInteger (final String text, final boolean isSigned, final boolean isLong) throws NumberFormatException |
static void | printUnknownFieldValue (final int tag, final Object value, final TextGenerator generator) throws IOException |
static TextGenerator | singleLineOutput (Appendable output) |
Static Private Attributes | |
static final Logger | logger = Logger.getLogger(TextFormat.class.getName()) |
static final Parser | PARSER = Parser.newBuilder().build() |
Provide text parsing and formatting support for proto2 instances. The implementation largely follows google/protobuf/text_format.cc.
Definition at line 55 of file TextFormat.java.
|
inlineprivate |
Definition at line 56 of file TextFormat.java.
|
inlinestaticprivate |
Interpret a character as a digit (in any base up to 36) and return the numeric value. This is like
but we don't accept non-ASCII digits.
Definition at line 2192 of file TextFormat.java.
|
inlinestatic |
Like escapeBytes(ByteString), but used for byte array.
Definition at line 2035 of file TextFormat.java.
|
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.
Definition at line 2030 of file TextFormat.java.
|
inlinestatic |
Escape double quotes and backslashes in a String for emittingUnicode output of a message.
Definition at line 2166 of file TextFormat.java.
|
inlinestatic |
Return a Parser instance which can parse text-format messages. The returned instance is thread-safe.
Definition at line 1283 of file TextFormat.java.
|
inlinestaticprivate |
Is this a hex digit?
Definition at line 2184 of file TextFormat.java.
|
inlinestaticprivate |
Is this an octal digit?
Definition at line 2179 of file TextFormat.java.
|
inlinestatic |
Parse a text-format message from
and merge the contents into
. Extensions will be recognized if they are registered in
.
Definition at line 1329 of file TextFormat.java.
|
inlinestatic |
Parse a text-format message from
and merge the contents into
.
Definition at line 1293 of file TextFormat.java.
|
inlinestatic |
Parse a text-format message from
and merge the contents into
. Extensions will be recognized if they are registered in
.
Definition at line 1316 of file TextFormat.java.
|
inlinestatic |
Parse a text-format message from
and merge the contents into
.
Definition at line 1288 of file TextFormat.java.
|
inlinestaticprivate |
Definition at line 648 of file TextFormat.java.
|
inlinestatic |
Parse a text-format message from
.
Definition at line 1303 of file TextFormat.java.
|
inlinestatic |
Parse a text-format message from
. Extensions will be recognized if they are registered in
.
Definition at line 1343 of file TextFormat.java.
|
inlinestaticprivate |
Definition at line 2240 of file TextFormat.java.
|
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)
Definition at line 68 of file TextFormat.java.
|
inlinestatic |
Outputs a textual representation of
to
.
Definition at line 79 of file TextFormat.java.
|
inlinestatic |
Printer instance which escapes non-ASCII characters.
Definition at line 280 of file TextFormat.java.
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
Outputs a textual representation of the value of given field value.
field | the descriptor of the field |
value | the value of the field |
output | the output to which to append the formatted value |
ClassCastException | if the value is not appropriate for the given field descriptor |
IOException | if there is an exception writing to the output |
Definition at line 223 of file TextFormat.java.
|
inlinestatic |
Like
, but writes directly to a
and returns it.
Definition at line 143 of file TextFormat.java.
|
inlinestatic |
Like
, but writes directly to a
and returns it.
Definition at line 153 of file TextFormat.java.
|
inlinestatic |
Same as
, except that non-ASCII characters in string type fields are not escaped in backslash+octals.
Definition at line 164 of file TextFormat.java.
|
inlinestatic |
Same as
, except that non-ASCII characters in string type fields are not escaped in backslash+octals.
Definition at line 175 of file TextFormat.java.
|
inlinestatic |
Same as
, except that non-ASCII characters are not escaped.
Definition at line 90 of file TextFormat.java.
|
inlinestatic |
Same as
, except that non-ASCII characters are not escaped.
Definition at line 101 of file TextFormat.java.
|
inlinestatic |
Outputs a unicode textual representation of the value of given field value.
Same as
, except that non-ASCII characters in string type fields are not escaped in backslash+octals.
field | the descriptor of the field |
value | the value of the field |
output | the output to which to append the formatted value |
ClassCastException | if the value is not appropriate for the given field descriptor |
IOException | if there is an exception writing to the output |
Definition at line 207 of file TextFormat.java.
|
inlinestatic |
Outputs a textual representation of the value of an unknown field.
tag | the field's tag number |
value | the value of the field |
output | the output to which to append the formatted value |
ClassCastException | if the value is not appropriate for the given field descriptor |
IOException | if there is an exception writing to the output |
Definition at line 237 of file TextFormat.java.
|
inlinestaticprivate |
Definition at line 242 of file TextFormat.java.
|
inlinestatic |
Generates a human readable form of the field, useful for debugging and other purposes, with no newline characters.
Definition at line 122 of file TextFormat.java.
|
inlinestatic |
Generates a human readable form of this message, useful for debugging and other purposes, with no newline characters. This is just a trivial wrapper around TextFormat.Printer#shortDebugString(MessageOrBuilder).
Definition at line 111 of file TextFormat.java.
|
inlinestatic |
Generates a human readable form of the unknown fields, useful for debugging and other purposes, with no newline characters.
Definition at line 133 of file TextFormat.java.
|
inlinestaticprivate |
Definition at line 652 of file TextFormat.java.
|
inlinestatic |
Un-escape a byte sequence as escaped using escapeBytes(ByteString). Two-digit hex escapes (starting with "\x") are also recognized.
Definition at line 2043 of file TextFormat.java.
|
inlinestatic |
Convert an unsigned 32-bit integer to a string.
Definition at line 629 of file TextFormat.java.
|
inlinestatic |
Convert an unsigned 64-bit integer to a string.
Definition at line 638 of file TextFormat.java.
|
staticprivate |
Definition at line 58 of file TextFormat.java.
|
staticprivate |
Definition at line 1277 of file TextFormat.java.