FileDocCategorySizeDatePackage
HtmlDocWriter.javaAPI DocExample8231Wed Apr 19 11:17:16 BST 2000com.sun.tools.doclets

HtmlDocWriter

public abstract class HtmlDocWriter extends HtmlWriter
Class for the Html Format Code Generation specific to JavaDoc. This Class contains methods related to the Html Code Generation which are used by the Sub-Classes in the package com.sun.tools.doclets.standard and com.sun.tools.doclets.oneone.
since
JDK1.2
author
Atul M Dambalkar
author
Robert Field

Fields Summary
public static Configuration
configuration
All the user given options on the command line.
Constructors Summary
public HtmlDocWriter(String filename)
Constructor. Initializes the destination file name through the super class HtmlWriter.

param
filename String file name.

        super(configuration.destdirname + filename, configuration.docencoding);
        configuration.message.notice("doclet.Generating_0", 
                       configuration.destdirname + filename);
    
public HtmlDocWriter(String path, String filename)

        super(configuration.destdirname + path, filename,  
              configuration.docencoding);
        configuration.message.notice("doclet.Generating_0", 
                                     configuration.destdirname + 
                                     ((path.length() > 0)? 
                                        path + File.separator: "") + filename);
    
Methods Summary
public java.lang.StringgetHyperLink(java.lang.String link, java.lang.String where, java.lang.String label, boolean bold)
Return Html Hyper Link string.

param
link String name of the file.
param
where Position of the link in the file. Character '#' is not needed.
param
label Tag for the link.
param
bold Boolean that sets label to bold.
return
String Hyper Link.

        return getHyperLink(link, where, label, bold, "");
    
public java.lang.StringgetHyperLink(java.lang.String link, java.lang.String where, java.lang.String label, boolean bold, java.lang.String stylename)
Get Html Hyper Link string.

param
link String name of the file.
param
where Position of the link in the file. Character '#' is not needed.
param
label Tag for the link.
param
bold Boolean that sets label to bold.
param
stylename String style of text defined in style sheet.
return
String Hyper Link.

        StringBuffer retlink = new StringBuffer();
        retlink.append("<A HREF=\"");
        retlink.append(link);
        if (where.length() != 0) {
            retlink.append("#");
            retlink.append(where);
        }
        retlink.append("\">");
        if (stylename.length() != 0) {
            retlink.append("<FONT CLASS=\"");
            retlink.append(stylename);
            retlink.append("\">");
        }
        if (bold) {
            retlink.append("<B>");
        }
        retlink.append(label);
        if (bold) {
            retlink.append("</B>");
        }
        if (stylename.length() != 0) {
            retlink.append("</FONT>");
        }
        retlink.append("</A>");
        return retlink.toString();
    
public java.lang.StringgetHyperLink(java.lang.String link, java.lang.String label)
Get link string without positioning in the file.

param
link String name of the file.
param
label Tag for the link.
return
Strign Hyper link.

        return getHyperLink(link, "", label, false);
    
public java.lang.StringgetPkgName(com.sun.javadoc.ClassDoc cd)
Get the name of the package, this class is in.

param
cd ClassDoc.

        String pkgName = cd.containingPackage().name();
	if (pkgName.length() > 0) {
            pkgName += ".";
            return pkgName;
        }
        return "";
    
public voidprintBodyHtmlEnd()
Print the closing </body> and </html> tags.

        println();
        bodyEnd();
        htmlEnd();
    
public voidprintFooter()
Calls {@link #printBodyHtmlEnd()} method.

        printBodyHtmlEnd();
    
public voidprintFrameFooter()
Print closing </html> tag.

        htmlEnd();
    
public voidprintHyperLink(java.lang.String link, java.lang.String where, java.lang.String label, boolean bold)
Print Html Hyper Link.

param
link String name of the file.
param
where Position of the link in the file. Character '#' is not needed.
param
label Tag for the link.
param
bold Boolean that sets label to bold.

        print(getHyperLink(link, where, label, bold, ""));
    
public voidprintHyperLink(java.lang.String link, java.lang.String where, java.lang.String label)
Print Html Hyper Link.

param
link String name of the file.
param
where Position of the link in the file. Character '#' is not needed.
param
label Tag for the link.

        printHyperLink(link, where, label, false);
    
public voidprintHyperLink(java.lang.String link, java.lang.String where, java.lang.String label, boolean bold, java.lang.String stylename)
Print Html Hyper Link.

param
link String name of the file.
param
where Position of the link in the file. Character '#' is not needed.
param
label Tag for the link.
param
bold Boolean that sets label to bold.
param
stylename String style of text defined in style sheet.

        print(getHyperLink(link, where, label, bold, stylename));
    
public voidprintHyperLink(java.lang.String link, java.lang.String label)
Print link without positioning in the file.

param
link String name of the file.
param
label Tag for the link.

        print(getHyperLink(link, "", label, false));
    
public voidprintNbsps()
Print ten non-breaking spaces("&nbsp;").

        print("          ");
    
public voidprintPartialHeader(java.lang.String title)
Print some part of the Html file header.

param
title Title of this HTML document.

        println("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 " + 
                "Transitional//EN\"" + 
                "\"http://www.w3.org/TR/REC-html40/loose.dtd>");
        println("<!--NewPage-->");
        html();
        head();
        print("<!-- Generated by javadoc on ");
        print(today());
        println("-->");
        title();
        println(title);
        titleEnd();
        headEnd();
    
public voidprintPkgName(com.sun.javadoc.ClassDoc cd)
Print the name of the package, this class is in.

param
cd ClassDoc.

        print(getPkgName(cd));
    
public java.lang.Stringspaces(int len)
Print the appropriate spaces to format the class tree in the class page.

param
len Number of spaces.

        String space = "";

        for (int i = 0; i < len; i++) {
            space += " ";
        }
        return space;
    
public java.lang.Stringtoday()
Get the day and date information for today, depending upon user option.

return
String Today.
see
java.util.Calender
see
java.util.GregorianCalendar
see
java.util.TimeZone

        if (configuration.nodate) {
            return "TODAY";
        }
        Calendar calendar = new GregorianCalendar(TimeZone.getDefault());
        return calendar.getTime().toString();