org.apache.hadoop.hbase.shell.formatter
Class HtmlTableFormatter

java.lang.Object
  extended by org.apache.hadoop.hbase.shell.formatter.HtmlTableFormatter
All Implemented Interfaces:
TableFormatter

public class HtmlTableFormatter
extends Object
implements TableFormatter

Formatter that outputs data inside an HTML table. If only a single cell result, then no formatting is done. Presumption is that client manages serial access outputting tables. Does not close passed Writer. Since hbase columns have no typing, the formatter presumes a type of UTF-8 String. If cells contain images, etc., this formatter will mangle their display.

TODO: Uses xmlenc. Hopefully it flushes every so often (Claims its a stream-based outputter). Verify.


Constructor Summary
HtmlTableFormatter(Writer o)
           
 
Method Summary
 void footer()
          Output footer.
 Writer getOut()
           
 void header(String[] titles)
          Output header.
 boolean isNoFormatting()
           
static void main(String[] args)
           
 void row(String[] cells)
          Output a row.
 void setNoFormatting(boolean noFormatting)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HtmlTableFormatter

public HtmlTableFormatter(Writer o)
Method Detail

header

public void header(String[] titles)
            throws IOException
Description copied from interface: TableFormatter
Output header.

Specified by:
header in interface TableFormatter
Parameters:
titles - List of titles. Pass null if no formatting (i.e. no header, no footer, etc.
Throws:
IOException

row

public void row(String[] cells)
         throws IOException
Description copied from interface: TableFormatter
Output a row.

Specified by:
row in interface TableFormatter
Throws:
IOException

footer

public void footer()
            throws IOException
Description copied from interface: TableFormatter
Output footer.

Specified by:
footer in interface TableFormatter
Throws:
IOException

getOut

public Writer getOut()
Specified by:
getOut in interface TableFormatter
Returns:
Output stream being used (This is in interface to enforce fact that formatters use Writers -- that they operate on character streams rather than on byte streams).

isNoFormatting

public boolean isNoFormatting()

setNoFormatting

public void setNoFormatting(boolean noFormatting)

main

public static void main(String[] args)
                 throws IOException
Throws:
IOException


Copyright © 2006 The Apache Software Foundation