org.dbunit.util
Class TableFormatter

java.lang.Object
  extended by org.dbunit.util.TableFormatter

public class TableFormatter
extends Object

Simple formatter to print out ITable objects in a beautiful way, for example on a console.

Since:
2.4.1
Version:
$Revision: 902 $ $Date: 2008-12-02 21:28:54 +0100 (Tue, 02 Dec 2008) $
Author:
gommma (gommma AT users.sourceforge.net), Last changed by: $Author: gommma $

Constructor Summary
TableFormatter()
           
 
Method Summary
 String format(ITable table)
          Formats a table with all data in a beautiful way.
static String padLeft(String s, int length, char padChar)
          Pads the given String with the given padChar up to the given length.
static String padRight(String s, int length, char padChar)
          Pads the given String with the given padChar up to the given length.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TableFormatter

public TableFormatter()
Method Detail

format

public String format(ITable table)
              throws DataSetException
Formats a table with all data in a beautiful way. Can be useful to print out the table data on a console.

Parameters:
table - The table to be formatted in a beautiful way
Returns:
The table data as a formatted String
Throws:
DataSetException

padLeft

public static final String padLeft(String s,
                                   int length,
                                   char padChar)
Pads the given String with the given padChar up to the given length.

Parameters:
s -
length -
padChar -
Returns:
The padded string

padRight

public static final String padRight(String s,
                                    int length,
                                    char padChar)
Pads the given String with the given padChar up to the given length.

Parameters:
s -
length -
padChar -
Returns:
The padded string


Copyright © 2002-2012. All Rights Reserved.