| Modifier and Type | Field and Description |
|---|---|
| private static final String | |
| private static final int |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| private static void | appendQuotedBytes(byte[] bytes, StringBuffer builder)
Appends a quoted byte array to the provided |
| private static String | deCamelCaseify(String identifier)
Converts an identifier of the format "FieldName" into "field_name". |
| private static String | |
| public static <T extends MessageNano> String | |
| private static void | print(String
the identifier to use, or identifier, Object null if this is the root message to
print.the value to print. May in fact be a primitive value or byte array and not a
message. object, StringBuffer the indentation each line should begin with. indentBuf, StringBuffer the output buffer. buf)Function that will print the given message/field into the StringBuffer. |
| private static String |
| INDENT | back to summary |
|---|---|
| private static final String INDENT | |
| MAX_STRING_LEN | back to summary |
|---|---|
| private static final int MAX_STRING_LEN | |
| MessageNanoPrinter | back to summary |
|---|---|
| private MessageNanoPrinter() | |
| appendQuotedBytes | back to summary |
|---|---|
| private static void appendQuotedBytes(byte[] bytes, StringBuffer builder) Appends a quoted byte array to the provided | |
| deCamelCaseify | back to summary |
|---|---|
| private static String deCamelCaseify(String identifier) Converts an identifier of the format "FieldName" into "field_name". | |
| escapeString | back to summary |
|---|---|
| private static String escapeString(String str) Escape everything except for low ASCII code points. | |
| back to summary | |
|---|---|
| public static <T extends MessageNano> String print(T message) Returns an text representation of a MessageNano suitable for debugging. The returned string is mostly compatible with Protocol Buffer's TextFormat (as provided by non-nano protocol buffers) -- groups (which are deprecated) are output with an underscore name (e.g. foo_bar instead of FooBar) and will thus not parse. Employs Java reflection on the given object and recursively prints primitive fields, groups, and messages. | |
| back to summary | |
|---|---|
| private static void print(String identifier, Object object, StringBuffer indentBuf, StringBuffer buf) throws IllegalAccessException, InvocationTargetException Function that will print the given message/field into the StringBuffer. Meant to be called recursively.
| |
| sanitizeString | back to summary |
|---|---|
| private static String sanitizeString(String str) Shortens and escapes the given string. | |