org.dbunit.util
Class TableFormatter

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

public class TableFormatter
extends java.lang.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 (mar, 02 dic 2008) $
Author:
gommma (gommma AT users.sourceforge.net), Last changed by: $Author: gommma $

Constructor Summary
TableFormatter()
           
 
Method Summary
 java.lang.String format(ITable table)
          Formats a table with all data in a beautiful way.
static java.lang.String padLeft(java.lang.String s, int length, char padChar)
          Pads the given String with the given padChar up to the given length.
static java.lang.String padRight(java.lang.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 java.lang.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 java.lang.String padLeft(java.lang.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 java.lang.String padRight(java.lang.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-2010. All Rights Reserved.