org.jtheque.utils
Class HTMLWriter

java.lang.Object
  extended by org.jtheque.utils.HTMLWriter
All Implemented Interfaces:
Closeable

public final class HTMLWriter
extends Object
implements Closeable

A HTML Writer.

Author:
Baptiste Wicht

Constructor Summary
HTMLWriter(PrintWriter writer)
          Construct a new HTML Writer.
 
Method Summary
 void close()
           
 void writeFooter()
          Write the footer.
 void writeHeader(String title)
          Writer an HTML Header.
 void writeHx(int h, String text)
          Write a Hx title.
 void writeTable(int width, String borders, int[] widths, String[] headers, Iterable<Iterable<String>> data)
          Write a table.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HTMLWriter

public HTMLWriter(PrintWriter writer)
Construct a new HTML Writer.

Parameters:
writer - The print writer in which we write.
Method Detail

close

public void close()
Specified by:
close in interface Closeable

writeHeader

public void writeHeader(String title)
Writer an HTML Header.

Parameters:
title - The title of the page.

writeFooter

public void writeFooter()
Write the footer.


writeHx

public void writeHx(int h,
                    String text)
Write a Hx title.

Parameters:
h - The level of the title.
text - The text of the title part.

writeTable

public void writeTable(int width,
                       String borders,
                       int[] widths,
                       String[] headers,
                       Iterable<Iterable<String>> data)
Write a table.

Parameters:
width - The width of the table.
borders - The border configuration.
widths - The widths of the columns.
headers - The headers of the table.
data - The data of the table.


Copyright © 2010 JTheque. All Rights Reserved.