All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class jp.kyasu.graphics.html.HTMLWriter

java.lang.Object
   |
   +----jp.kyasu.graphics.html.HTMLWriter

public class HTMLWriter
extends Object
implements Serializable
The HTMLWriter class implements the writer that saves the HTMLText object as a HTML document ('text/html').

For example:

    HTMLText htmlText = ...;
    HTMLWriter htmlWriter = new HTMLWriter(htmlText);
    try {
        htmlWriter.writeTo(new File("index.html"));
    }
    catch (IOException e) { return; }
 

Version:
08 May 1998
Author:
Kazuki YASUMATSU
See Also:
HTMLStyle, HTMLText

Variable Index

 o GENERATOR
The constant for the GENERATOR attribure for the META tag.

Constructor Index

 o HTMLWriter(HTMLText)
Constructs a html writer with the specified html text.

Method Index

 o writeTo(File)
Writes the html document as a HTML document ('text/html') into the specified file.
 o writeTo(File, String)
Writes the html document as a HTML document ('text/html') into the specified file with the specified encoding.
 o writeTo(File, Writer)
Writes the html document as a HTML document ('text/html') into the specified writer with the base file.

Variables

 o GENERATOR
 public static final String GENERATOR
The constant for the GENERATOR attribure for the META tag.

Constructors

 o HTMLWriter
 public HTMLWriter(HTMLText htmlText)
Constructs a html writer with the specified html text.

Parameters:
htmlText - the html text to be saved.

Methods

 o writeTo
 public void writeTo(File file) throws IOException
Writes the html document as a HTML document ('text/html') into the specified file.

Parameters:
file - the file to be saved into.
Throws: IOException
If an I/O error occurs.
 o writeTo
 public void writeTo(File file,
                     String encodingName) throws IOException
Writes the html document as a HTML document ('text/html') into the specified file with the specified encoding.

Parameters:
file - the file to be saved into.
encodingName - the encoding name for writing.
Throws: IOException
If an I/O error occurs.
 o writeTo
 public void writeTo(File baseFile,
                     Writer writer) throws IOException
Writes the html document as a HTML document ('text/html') into the specified writer with the base file.

Parameters:
baseFile - the base file. the src attribute of the IMG tag are genarated as a pathname relative to the baseFile.
writer - the writer to be saved into.
Throws: IOException
If an I/O error occurs.

All Packages  Class Hierarchy  This Package  Previous  Next  Index