|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.sun.tools.doclets.internal.toolkit.util.SourceToHTMLConverter
public class SourceToHTMLConverter
Converts Java Source Code to HTML. This code is not part of an API. It is implementation that is subject to change. Do not use it as an API
| Field Summary | |
|---|---|
protected static java.lang.String |
BGCOLOR
The background color. |
protected static java.lang.String |
LINE_NO_COLOR
The line number color. |
protected static int |
NUM_BLANK_LINES
The number of trailing blank lines at the end of the page. |
| Constructor Summary | |
|---|---|
private |
SourceToHTMLConverter()
Source is converted to HTML using static methods below. |
| Method Summary | |
|---|---|
private static java.lang.StringBuffer |
addLineNumbers(java.lang.String s)
Given a String, add line numbers. |
protected static void |
addToHash(Doc[] docs,
java.util.HashMap<java.lang.Integer,java.lang.String> hash)
Given an array of Docs, add to the given HashMap the
line numbers and anchors that should be inserted in the output at those lines. |
static void |
convertClass(Configuration configuration,
ClassDoc cd,
java.lang.String outputdir)
Convert the given Class to an HTML. |
static void |
convertPackage(Configuration configuration,
PackageDoc pd,
java.lang.String outputdir)
Convert the Classes in the given Package to an HTML. |
static void |
convertRoot(Configuration configuration,
RootDoc rd,
java.lang.String outputdir)
Convert the Classes in the given RootDoc to an HTML. |
protected static java.lang.String |
formatLine(java.lang.String line,
int tabLength,
int currentLineNo)
Format a given line of source. |
protected static java.lang.String |
getAnchor(Doc d)
Given a Doc, return an anchor for it. |
static java.lang.String |
getAnchorName(Doc d)
Given a Doc, return an anchor name for it. |
protected static java.lang.String |
getFooter()
Get the footer |
protected static java.lang.String |
getHeader(Configuration configuration)
Get the header. |
protected static java.lang.String |
getHTMLLineNo(int lineno)
Get the HTML for the lines. |
private static java.lang.String |
getPackageOutputDir(java.lang.String outputDir,
PackageDoc pd)
Return the directory write output to for the given package. |
private static void |
writeToFile(java.lang.String output,
java.lang.String outputDir,
java.lang.String className,
Configuration configuration)
Write the output to the file. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final java.lang.String BGCOLOR
protected static final java.lang.String LINE_NO_COLOR
protected static final int NUM_BLANK_LINES
| Constructor Detail |
|---|
private SourceToHTMLConverter()
| Method Detail |
|---|
public static void convertRoot(Configuration configuration,
RootDoc rd,
java.lang.String outputdir)
configuration - the configuration.rd - the RootDoc to convert.outputdir - the name of the directory to output to.
public static void convertPackage(Configuration configuration,
PackageDoc pd,
java.lang.String outputdir)
configuration - the configuration.pd - the Package to convert.outputdir - the name of the directory to output to.
private static java.lang.String getPackageOutputDir(java.lang.String outputDir,
PackageDoc pd)
outputDir - the directory to output to.pd - the Package to generate output for.
public static void convertClass(Configuration configuration,
ClassDoc cd,
java.lang.String outputdir)
configuration - the configuration.cd - the class to convert.outputdir - the name of the directory to output to.
private static void writeToFile(java.lang.String output,
java.lang.String outputDir,
java.lang.String className,
Configuration configuration)
throws java.io.IOException
output - the string to output.outputDir - the directory to output to.className - the name of the class that I am converting to HTML.configuration - the Doclet configuration to pass notices to.
java.io.IOExceptionprivate static java.lang.StringBuffer addLineNumbers(java.lang.String s)
String, add line numbers.
s - the text to add line numbers to.
protected static java.lang.String getHeader(Configuration configuration)
configuration - the Doclet configuration
protected static java.lang.String getFooter()
protected static java.lang.String getHTMLLineNo(int lineno)
lineno - The line number
protected static java.lang.String formatLine(java.lang.String line,
int tabLength,
int currentLineNo)
line - the string to format.tabLength - the number of spaces for each tab.currentLineNo - the current number.
protected static void addToHash(Doc[] docs,
java.util.HashMap<java.lang.Integer,java.lang.String> hash)
Docs, add to the given HashMap the
line numbers and anchors that should be inserted in the output at those lines.
docs - the array of Docs to add anchors for.hash - the HashMap to add to.protected static java.lang.String getAnchor(Doc d)
Doc, return an anchor for it.
d - the Doc to check.
public static java.lang.String getAnchorName(Doc d)
Doc, return an anchor name for it.
d - the Doc to check.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||