Class 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:
    HTMLWriter
    • Constructor Detail

      • HTMLWriterEx

        public HTMLWriterEx​(java.io.Writer out)
                     throws java.io.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:
        java.io.IOException - if there is a problem writing to the underlying stream
      • HTMLWriterEx

        public HTMLWriterEx​(java.io.Writer out,
                            java.lang.String docType)
                     throws java.io.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:
        java.io.IOException - if there is a problem writing to the underlying stream
      • HTMLWriterEx

        public HTMLWriterEx​(java.io.Writer out,
                            I18NResourceBundle i18n)
                     throws java.io.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:
        java.io.IOException - if there is a problem writing to the underlying stream
      • HTMLWriterEx

        public HTMLWriterEx​(java.io.Writer out,
                            java.lang.String docType,
                            I18NResourceBundle i18n)
                     throws java.io.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:
        java.io.IOException - if there is a problem writing to the underlying stream
    • Method Detail

      • writeContentMeta

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

        public void writeContentMeta​(java.nio.charset.Charset charSet)
                              throws java.io.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:
        java.io.IOException