Class HTMLWriterEx

java.lang.Object
com.sun.javatest.util.HTMLWriter
com.sun.javatest.report.HTMLWriterEx

public class HTMLWriterEx extends HTMLWriter
A class to facilitate writing HTML via a stream. Extends HTMLWriter and adds some specific functionality which requires newer than JDK 1.1 API The base class, according to the convention, must be compatible with jdk 1.1 so such functionality was implemented here outside of com.sun.javatest.util
See Also:
  • Constructor Details

    • HTMLWriterEx

      public HTMLWriterEx(Writer out) throws IOException
      Create an HTMLWriterEx object, using a default doctype for HTML 3.2.
      Parameters:
      out - a Writer to which to write the generated HTML
      Throws:
      IOException - if there is a problem writing to the underlying stream
    • HTMLWriterEx

      public HTMLWriterEx(Writer out, String docType) throws IOException
      Create an HTMLWriterEx object, using a specified doctype header.
      Parameters:
      out - a Writer to which to write the generated HTML
      docType - a string containing a doctype header for the HTML to be generated
      Throws:
      IOException - if there is a problem writing to the underlying stream
    • HTMLWriterEx

      public HTMLWriterEx(Writer out, I18NResourceBundle i18n) throws IOException
      Create an HTMLWriterEx object, using a specified bundle for localizing messages.
      Parameters:
      out - a Writer to which to write the generated HTML
      i18n - a resource bundle to use to localize messages
      Throws:
      IOException - if there is a problem writing to the underlying stream
    • HTMLWriterEx

      public HTMLWriterEx(Writer out, String docType, I18NResourceBundle i18n) throws IOException
      Create an HTMLWriterEx object, using a specified doctype header and using a specified bundle for localizing messages.
      Parameters:
      out - a Writer to which to write the generated HTML
      docType - a string containing a doctype header for the HTML to be generated
      i18n - a resource bundle to use to localize messages
      Throws:
      IOException - if there is a problem writing to the underlying stream
  • Method Details

    • writeContentMeta

      public void writeContentMeta() throws IOException
      Write Content-Type meta tag using default charset: This must go inside the <head> element!
      Throws:
      IOException
    • writeContentMeta

      public void writeContentMeta(Charset charSet) throws IOException
      Write Content-Type meta tag using given charset: This must go inside the <head> element! The Charset provided should be available on the current runtime. If the Charset provided is null, the runtime default charset will be used - by calling the no-param version of this method.
      Parameters:
      charSet - Character set to use, must not be null.
      Throws:
      IOException