예제 #1
0
 /**
  * Generates a human readable form of the field, useful for debugging
  * and other purposes, with no newline characters.
  */
 public static String shortDebugString(final FieldDescriptor field,
                                       final Object value) {
   try {
     final StringBuilder sb = new StringBuilder();
     SINGLE_LINE_PRINTER.printField(field, value, new TextGenerator(sb));
     return sb.toString().trim();
   } catch (IOException e) {
       throw new IllegalStateException(e);
   }
 }
예제 #2
0
 public static void printField(final FieldDescriptor field,
                               final Object value,
                               final Appendable output)
                               throws IOException {
   DEFAULT_PRINTER.printField(field, value, new TextGenerator(output));
 }