|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.io.Writer
java.io.PrintWriter
com.sun.tools.doclets.formats.html.markup.HtmlWriter
com.sun.tools.doclets.formats.html.markup.HtmlDocWriter
com.sun.tools.doclets.formats.html.HtmlDocletWriter
public class HtmlDocletWriter
Class for the Html Format Code Generation specific to JavaDoc. This Class contains methods related to the Html Code Generation which are used extensively while generating the entire documentation.
| Field Summary | |
|---|---|
ConfigurationImpl |
configuration
The global configuration information for this run. |
int |
displayLength
The display length used for indentation while generating the class page. |
java.lang.String |
filename
Name of the file getting generated. |
java.lang.String |
path
Platform-dependent directory path from the current or the destination directory to the file getting generated. |
java.lang.String |
relativePath
Relative path from the file getting generated to the destination directory. |
java.lang.String |
relativepathNoSlash
Same as relativepath, but normalized to never be empty or end with a slash. |
| Fields inherited from class com.sun.tools.doclets.formats.html.markup.HtmlWriter |
|---|
fileseparator, htmlFilename, winTitle |
| Fields inherited from class java.io.PrintWriter |
|---|
out |
| Fields inherited from class java.io.Writer |
|---|
lock |
| Constructor Summary | |
|---|---|
HtmlDocletWriter(ConfigurationImpl configuration,
java.lang.String filename)
Constructor to construct the HtmlStandardWriter object. |
|
HtmlDocletWriter(ConfigurationImpl configuration,
java.lang.String path,
java.lang.String filename,
java.lang.String relativePath)
Constructor to construct the HtmlStandardWriter object. |
|
| Method Summary | |
|---|---|
void |
anchor(ExecutableMemberDoc emd)
|
private java.lang.String |
annotationValueToString(AnnotationValue annotationValue)
|
java.lang.String |
commentTagsToString(Tag holderTag,
Doc doc,
Tag[] tags,
boolean isFirstSentence)
Converts inline tags and text to text strings, expanding the inline tags along the way. |
Configuration |
configuration()
Return the configuation for this doclet. |
void |
frame(java.lang.String arg)
Print Html tag <FRAME=arg>. |
void |
frameEnd()
Print Html closing tag </FRAME>. |
void |
frameSet(java.lang.String arg)
Print Html tag <FRAMESET=arg>. |
void |
frameSetEnd()
Print Html closing tag </FRAMESET>. |
java.lang.String |
getAnchor(ExecutableMemberDoc emd)
|
private java.util.List<java.lang.String> |
getAnnotations(int indent,
AnnotationDesc[] descList,
boolean linkBreak)
Return the string representations of the annotation types for the given doc. |
java.lang.String |
getCrossClassLink(java.lang.String qualifiedClassName,
java.lang.String refMemName,
java.lang.String label,
boolean strong,
java.lang.String style,
boolean code)
Return a class cross link to external class documentation. |
java.lang.String |
getCrossPackageLink(java.lang.String pkgName)
|
java.lang.String |
getDocLink(int context,
ClassDoc classDoc,
MemberDoc doc,
java.lang.String label,
boolean strong)
Return the link for the given member. |
java.lang.String |
getDocLink(int context,
MemberDoc doc,
java.lang.String label,
boolean strong)
Return the link for the given member. |
java.lang.String |
getLink(LinkInfoImpl linkInfo)
Return the link to the given class. |
java.lang.String |
getPackageLink(PackageDoc pkg,
java.lang.String label,
boolean isStrong)
Return the link to the given package. |
java.lang.String |
getPackageLink(PackageDoc pkg,
java.lang.String label,
boolean isStrong,
java.lang.String style)
Return the link to the given package. |
java.lang.String |
getPreQualifiedClassLink(int context,
ClassDoc cd,
boolean isStrong)
Retrieve the class link with the package portion of the label in plain text. |
TagletWriter |
getTagletWriterInstance(boolean isFirstSentence)
Returns a TagletWriter that knows how to write HTML. |
java.lang.String |
getTypeParameterLinks(LinkInfoImpl linkInfo)
Return the type parameters for the given class. |
boolean |
isClassLinkable(ClassDoc cd)
|
boolean |
isCoreClass(ClassDoc cd)
According to the Java Language Specifications, all the outer classes and static nested classes are core classes. |
java.lang.String |
italicsClassName(ClassDoc cd,
boolean qual)
|
protected void |
navCellEnd()
Closing tag for navigation bar cell. |
protected void |
navCellRevStart()
Description for a cell in the navigation bar, but with reverse high-light effect. |
protected void |
navCellStart()
Description for a cell in the navigation bar. |
protected void |
navDetail()
Print the word "Detail" in the navigation bar. |
protected void |
navHideLists(java.lang.String link)
Print "NO FRAMES" link, to switch to the non-frame version of the output. |
protected void |
navLinkClass()
Print the word "Class" in the navigation bar cell, to indicate that class link is not available. |
protected void |
navLinkClassIndex()
Print link for generated index. |
protected void |
navLinkClassUse()
Print the word "Use" in the navigation bar cell, to indicate that link is not available. |
protected void |
navLinkContents()
Print link to the "overview-summary.html" page. |
protected void |
navLinkDeprecated()
Print "Deprecated" API link in the navigation bar. |
protected void |
navLinkHelp()
Print help file link. |
protected void |
navLinkIndex()
Print link for generated class index. |
protected void |
navLinkMainTree(java.lang.String label)
Print "Tree" link to the "overview-tree.html" file. |
protected void |
navLinkNext()
Print the word "NEXT" to indicate that no link is available. |
void |
navLinkNext(java.lang.String next)
Print link for next file. |
protected void |
navLinkPackage()
Print the word "Package" in the navigation bar cell, to indicate that link is not available here. |
protected void |
navLinkPackage(PackageDoc pkg)
Print link to the "package-summary.html" page for the package passed. |
protected void |
navLinkPrevious()
Print the word "PREV" to indicate that no link is available. |
void |
navLinkPrevious(java.lang.String prev)
Print link for previous file. |
protected void |
navLinks(boolean header)
Print the navigation bar for the Html page at the top and and the bottom. |
protected void |
navLinkTree()
Print "Tree" link in the navigation bar. |
protected void |
navShowLists()
Print "FRAMES" link, to switch to the frame version of the output. |
protected void |
navShowLists(java.lang.String link)
Print "FRAMES" link, to switch to the frame version of the output. |
protected void |
navSummary()
Print the word "Summary" in the navigation bar. |
protected java.lang.String |
pathString(ClassDoc cd,
java.lang.String name)
Return the path to the class page for a classdoc. |
protected java.lang.String |
pathString(PackageDoc pd,
java.lang.String name)
Return path to the given file name in the given package. |
protected java.lang.String |
pathToClass(ClassDoc cd)
Return path to the class page for a classdoc. |
void |
printBottom()
Print the user specified bottom. |
private void |
printCommentTags(Doc doc,
Tag[] tags,
boolean depr,
boolean first)
|
void |
printDocLink(int context,
ClassDoc classDoc,
MemberDoc doc,
java.lang.String label,
boolean strong)
Print the link for the given member. |
void |
printDocLink(int context,
MemberDoc doc,
java.lang.String label,
boolean strong)
Print the link for the given member. |
void |
printHtmlHeader(java.lang.String title,
java.lang.String[] metakeywords,
boolean includeScript)
Print the html file header. |
void |
printIndexHeading(java.lang.String str)
Print the heading in Html <H2> format. |
void |
printInlineComment(Doc doc)
|
void |
printInlineComment(Doc doc,
Tag tag)
|
void |
printInlineDeprecatedComment(Doc doc)
|
void |
printInlineDeprecatedComment(Doc doc,
Tag tag)
|
void |
printLink(LinkInfoImpl linkInfo)
Print the link to the given class. |
private void |
printMethodInfo(MethodDoc method)
|
void |
printNoFramesTargetHyperLink(java.lang.String link,
java.lang.String where,
java.lang.String target,
java.lang.String label,
boolean strong)
Print Html Hyper Link, with target frame. |
void |
printPackageLink(PackageDoc pkg,
java.lang.String label,
boolean isStrong)
Print the link to the given package. |
void |
printPackageLink(PackageDoc pkg,
java.lang.String label,
boolean isStrong,
java.lang.String style)
Print the link to the given package. |
void |
printPreQualifiedClassLink(int context,
ClassDoc cd)
Print Class link, with only class name as the link and prefixing plain package name. |
void |
printPreQualifiedStrongClassLink(int context,
ClassDoc cd)
Print Class link, with only class name as the strong link and prefixing plain package name. |
void |
printQualifiedClassLink(int context,
ClassDoc cd)
|
void |
printSrcLink(ProgramElementDoc d,
java.lang.String label)
|
void |
printStyleSheetProperties()
|
void |
printSummaryComment(Doc doc)
|
void |
printSummaryComment(Doc doc,
Tag[] firstSentenceTags)
|
void |
printSummaryDeprecatedComment(Doc doc)
|
void |
printSummaryDeprecatedComment(Doc doc,
Tag tag)
|
protected void |
printSummaryDetailLinks()
Do nothing. |
protected void |
printTags(Doc doc)
|
protected void |
printTagsInfoFooter()
|
protected void |
printTagsInfoHeader()
|
void |
printTargetPackageLink(PackageDoc pd,
java.lang.String target,
java.lang.String label)
Print Package link, with target frame. |
void |
printText(java.lang.String key)
|
void |
printText(java.lang.String key,
java.lang.String a1)
|
void |
printText(java.lang.String key,
java.lang.String a1,
java.lang.String a2)
|
void |
printTop()
Print the user specified top. |
void |
printUserHeaderFooter(boolean header)
Print user specified header and the footer. |
private java.lang.String |
redirectRelativeLinks(Doc doc,
java.lang.String text)
Suppose a piece of documentation has a relative link. |
java.lang.String |
removeNonInlineHtmlTags(java.lang.String text)
|
java.lang.String |
replace(java.lang.String text,
java.lang.String tobe,
java.lang.String by)
|
java.lang.String |
replaceDocRootDir(java.lang.String htmlstr)
Replace {@docRoot} tag used in options that accept HTML text, such as -header, -footer, -top and -bottom, and when converting a relative HREF where commentTagsToString inserts a {@docRoot} where one was missing. |
java.lang.String |
seeTagToString(SeeTag see)
|
private boolean |
shouldNotRedirectRelativeLinks()
Return true if relative links should not be redirected. |
void |
strongText(java.lang.String key)
|
void |
strongText(java.lang.String key,
java.lang.String a1)
|
void |
strongText(java.lang.String key,
java.lang.String a1,
java.lang.String a2)
|
void |
summaryRow(int width)
Print the summary table row cell attribute width. |
void |
summaryRowEnd()
Print the summary table row cell end tag. |
void |
tableHeaderEnd()
Print table header end tags for font, column and row. |
void |
tableHeaderStart()
Print table header with default column span 2 and default color #CCCCFF. |
void |
tableHeaderStart(int span)
Print table header with the column span, with the default color #CCCCFF. |
void |
tableHeaderStart(java.lang.String color)
Print table header with the background color with default column span 2. |
void |
tableHeaderStart(java.lang.String color,
int span)
Prine table header information about color, column span and the font. |
void |
tableIndexDetail()
Same as tableIndexSummary(). |
void |
tableIndexSummary()
Print the Html table tag for the index summary tables. |
void |
tableInheritedHeaderEnd()
Print table header end tags in inherited tables for column and row. |
void |
tableInheritedHeaderStart(java.lang.String color)
Print table header for the inherited members summary tables. |
void |
tableUseInfoHeaderStart(java.lang.String color)
Print "Use" table header. |
void |
tdIndex()
Print Html tag for table elements. |
private void |
writeAnnotationInfo(Doc doc,
AnnotationDesc[] descList)
Write the annotatation types for the given doc. |
private boolean |
writeAnnotationInfo(int indent,
Doc doc,
AnnotationDesc[] descList,
boolean lineBreak)
Write the annotatation types for the given doc. |
boolean |
writeAnnotationInfo(int indent,
Doc doc,
Parameter param)
Write the annotatation types for the given doc and parameter. |
void |
writeAnnotationInfo(PackageDoc packageDoc)
Write the annotatation types for the given packageDoc. |
void |
writeAnnotationInfo(ProgramElementDoc doc)
Write the annotatation types for the given doc. |
| Methods inherited from class com.sun.tools.doclets.formats.html.markup.HtmlDocWriter |
|---|
getHyperLink, getHyperLink, getHyperLink, getHyperLink, getPkgName, printBodyHtmlEnd, printFooter, printFrameFooter, printFramesetHeader, printFramesetHeader, printHyperLink, printHyperLink, printHyperLink, printHyperLink, printNbsps, printPkgName, spaces, today |
| Methods inherited from class java.io.PrintWriter |
|---|
append, append, append, checkError, close, flush, format, format, print, print, print, print, print, print, print, print, print, printf, printf, println, println, println, println, println, println, println, println, println, println, setError, write, write, write, write, write |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public java.lang.String relativePath
public java.lang.String relativepathNoSlash
public java.lang.String path
public java.lang.String filename
public int displayLength
public ConfigurationImpl configuration
| Constructor Detail |
|---|
public HtmlDocletWriter(ConfigurationImpl configuration,
java.lang.String filename)
throws java.io.IOException
filename - File to be generated.
java.io.IOException
public HtmlDocletWriter(ConfigurationImpl configuration,
java.lang.String path,
java.lang.String filename,
java.lang.String relativePath)
throws java.io.IOException
path - Platform-dependent path used when
creating file.filename - Name of file to be generated.relativePath - Value for the variable relativePath.
java.io.IOException| Method Detail |
|---|
public java.lang.String replaceDocRootDir(java.lang.String htmlstr)
Replace {@docRoot} tag in htmlstr with the relative path to the destination directory from the directory where the file is being written, looping to handle all such tags in htmlstr.
For example, for "-d docs" and -header containing {@docRoot}, when the HTML page for source file p/C1.java is being generated, the {@docRoot} tag would be inserted into the header as "../", the relative path from docs/p/ to docs/ (the document root).
Note: This doc comment was written with '@' representing '@' to prevent the inline tag from being interpreted.
public void printNoFramesTargetHyperLink(java.lang.String link,
java.lang.String where,
java.lang.String target,
java.lang.String label,
boolean strong)
link - String name of the file.where - Position in the filetarget - Name of the target frame.label - Tag for the link.strong - Whether the label should be strong or not?private void printMethodInfo(MethodDoc method)
protected void printTags(Doc doc)
public TagletWriter getTagletWriterInstance(boolean isFirstSentence)
protected void printTagsInfoHeader()
protected void printTagsInfoFooter()
public void printTargetPackageLink(PackageDoc pd,
java.lang.String target,
java.lang.String label)
pd - The link will be to the "package-summary.html" page for this
package.target - Name of the target frame.label - Tag for the link.
public void printHtmlHeader(java.lang.String title,
java.lang.String[] metakeywords,
boolean includeScript)
title - String window title to go in the <TITLE> tagmetakeywords - Array of String keywords for META tag. Each element
of the array is assigned to a separate META tag.
Pass in null for no array.includeScript - boolean true if printing windowtitle script.
False for files that appear in the left-hand frames.public void printUserHeaderFooter(boolean header)
header - if true print the user provided header else print the
user provided footer.public void printTop()
public void printBottom()
protected void navLinks(boolean header)
header - If true print navigation bar at the top of the page else
print the nevigation bar at the bottom.protected void navLinkNext()
protected void navLinkPrevious()
protected void printSummaryDetailLinks()
protected void navLinkContents()
protected void navCellStart()
protected void navCellRevStart()
protected void navCellEnd()
protected void navLinkPackage(PackageDoc pkg)
pkg - Package to which link will be generated.protected void navLinkPackage()
protected void navLinkClassUse()
public void navLinkPrevious(java.lang.String prev)
prev - File name for the prev link.public void navLinkNext(java.lang.String next)
next - File name for the next link.protected void navShowLists(java.lang.String link)
link - File to be linked, "index.html".protected void navShowLists()
protected void navHideLists(java.lang.String link)
link - File to be linked.protected void navLinkTree()
protected void navLinkMainTree(java.lang.String label)
protected void navLinkClass()
protected void navLinkDeprecated()
protected void navLinkClassIndex()
protected void navLinkIndex()
protected void navLinkHelp()
protected void navDetail()
protected void navSummary()
public void tableIndexSummary()
public void tableIndexDetail()
tableIndexSummary().
public void tdIndex()
public void tableHeaderStart(java.lang.String color,
int span)
color - Background color.span - Column span.public void tableInheritedHeaderStart(java.lang.String color)
color - Background color.public void tableUseInfoHeaderStart(java.lang.String color)
color - Background color.public void tableHeaderStart(java.lang.String color)
color - Background color.public void tableHeaderStart(int span)
span - Column span.public void tableHeaderStart()
public void tableHeaderEnd()
public void tableInheritedHeaderEnd()
public void summaryRow(int width)
width - Width of the table cell.public void summaryRowEnd()
public void printIndexHeading(java.lang.String str)
str - The Header string.public void frameSet(java.lang.String arg)
arg - Argument for the tag.public void frameSetEnd()
public void frame(java.lang.String arg)
arg - Argument for the tag.public void frameEnd()
protected java.lang.String pathToClass(ClassDoc cd)
cd - Class to which the path is requested.
protected java.lang.String pathString(ClassDoc cd,
java.lang.String name)
pathToClass(ClassDoc).
cd - Class to which the path is requested.name - Name of the file(doesn't include path).
protected java.lang.String pathString(PackageDoc pd,
java.lang.String name)
pd - Package in which the file name is assumed to be.name - File name, to which path string is.
public void printPackageLink(PackageDoc pkg,
java.lang.String label,
boolean isStrong)
pkg - the package to link to.label - the label for the link.isStrong - true if the label should be strong.
public void printPackageLink(PackageDoc pkg,
java.lang.String label,
boolean isStrong,
java.lang.String style)
pkg - the package to link to.label - the label for the link.isStrong - true if the label should be strong.style - the font of the package link label.
public java.lang.String getPackageLink(PackageDoc pkg,
java.lang.String label,
boolean isStrong)
pkg - the package to link to.label - the label for the link.isStrong - true if the label should be strong.
public java.lang.String getPackageLink(PackageDoc pkg,
java.lang.String label,
boolean isStrong,
java.lang.String style)
pkg - the package to link to.label - the label for the link.isStrong - true if the label should be strong.style - the font of the package link label.
public java.lang.String italicsClassName(ClassDoc cd,
boolean qual)
public void printSrcLink(ProgramElementDoc d,
java.lang.String label)
public java.lang.String getLink(LinkInfoImpl linkInfo)
linkInfo - the information about the link.
public java.lang.String getTypeParameterLinks(LinkInfoImpl linkInfo)
linkInfo - the information about the link.
public void printLink(LinkInfoImpl linkInfo)
public java.lang.String getCrossClassLink(java.lang.String qualifiedClassName,
java.lang.String refMemName,
java.lang.String label,
boolean strong,
java.lang.String style,
boolean code)
qualifiedClassName - the qualified name of the external class.refMemName - the name of the member being referenced. This should
be null or empty string if no member is being referenced.label - the label for the external link.strong - true if the link should be strong.style - the style of the link.code - true if the label should be code font.public boolean isClassLinkable(ClassDoc cd)
public java.lang.String getCrossPackageLink(java.lang.String pkgName)
public void printQualifiedClassLink(int context,
ClassDoc cd)
public void printPreQualifiedClassLink(int context,
ClassDoc cd)
public java.lang.String getPreQualifiedClassLink(int context,
ClassDoc cd,
boolean isStrong)
cd - the class to link to.isStrong - true if the link should be strong.
public void printPreQualifiedStrongClassLink(int context,
ClassDoc cd)
public void printText(java.lang.String key)
public void printText(java.lang.String key,
java.lang.String a1)
public void printText(java.lang.String key,
java.lang.String a1,
java.lang.String a2)
public void strongText(java.lang.String key)
public void strongText(java.lang.String key,
java.lang.String a1)
public void strongText(java.lang.String key,
java.lang.String a1,
java.lang.String a2)
public void printDocLink(int context,
MemberDoc doc,
java.lang.String label,
boolean strong)
context - the id of the context where the link will be printed.doc - the member being linked to.label - the label for the link.strong - true if the link should be strong.
public void printDocLink(int context,
ClassDoc classDoc,
MemberDoc doc,
java.lang.String label,
boolean strong)
context - the id of the context where the link will be printed.classDoc - the classDoc that we should link to. This is not
necessarily equal to doc.containingClass(). We may be
inheriting comments.doc - the member being linked to.label - the label for the link.strong - true if the link should be strong.
public java.lang.String getDocLink(int context,
MemberDoc doc,
java.lang.String label,
boolean strong)
context - the id of the context where the link will be printed.doc - the member being linked to.label - the label for the link.strong - true if the link should be strong.
public java.lang.String getDocLink(int context,
ClassDoc classDoc,
MemberDoc doc,
java.lang.String label,
boolean strong)
context - the id of the context where the link will be printed.classDoc - the classDoc that we should link to. This is not
necessarily equal to doc.containingClass(). We may be
inheriting comments.doc - the member being linked to.label - the label for the link.strong - true if the link should be strong.
public void anchor(ExecutableMemberDoc emd)
public java.lang.String getAnchor(ExecutableMemberDoc emd)
public java.lang.String seeTagToString(SeeTag see)
public void printInlineComment(Doc doc,
Tag tag)
public void printInlineDeprecatedComment(Doc doc,
Tag tag)
public void printSummaryComment(Doc doc)
public void printSummaryComment(Doc doc,
Tag[] firstSentenceTags)
public void printSummaryDeprecatedComment(Doc doc)
public void printSummaryDeprecatedComment(Doc doc,
Tag tag)
public void printInlineComment(Doc doc)
public void printInlineDeprecatedComment(Doc doc)
private void printCommentTags(Doc doc,
Tag[] tags,
boolean depr,
boolean first)
public java.lang.String commentTagsToString(Tag holderTag,
Doc doc,
Tag[] tags,
boolean isFirstSentence)
holderTag - specific tag where comment residesdoc - specific doc where comment residestags - array of text tags and inline tags (often alternating)
present in the text of interest for this docisFirstSentence - true if text is first sentenceprivate boolean shouldNotRedirectRelativeLinks()
private java.lang.String redirectRelativeLinks(Doc doc,
java.lang.String text)
Here is the algorithm used to fix the link:
<relative link> => docRoot + <relative path to file> + <relative link>
For example, suppose com.sun.javadoc.RootDoc has this link: <a href="package-summary.html">The package Page</a>
If this link appeared in the index, we would redirect the link like this: <a href="./com/sun/javadoc/package-summary.html">The package Page</a>
doc - the Doc object whose documentation is being written.text - the text being written.
public java.lang.String removeNonInlineHtmlTags(java.lang.String text)
public java.lang.String replace(java.lang.String text,
java.lang.String tobe,
java.lang.String by)
public void printStyleSheetProperties()
public boolean isCoreClass(ClassDoc cd)
public void writeAnnotationInfo(PackageDoc packageDoc)
packageDoc - the package to write annotations for.public void writeAnnotationInfo(ProgramElementDoc doc)
doc - the doc to write annotations for.
public boolean writeAnnotationInfo(int indent,
Doc doc,
Parameter param)
indent - the number of spaced to indent the parameters.doc - the doc to write annotations for.param - the parameter to write annotations for.
private void writeAnnotationInfo(Doc doc,
AnnotationDesc[] descList)
doc - the doc to write annotations for.descList - the array of AnnotationDesc.
private boolean writeAnnotationInfo(int indent,
Doc doc,
AnnotationDesc[] descList,
boolean lineBreak)
indent - the number of extra spaces to indent the annotations.doc - the doc to write annotations for.descList - the array of AnnotationDesc.
private java.util.List<java.lang.String> getAnnotations(int indent,
AnnotationDesc[] descList,
boolean linkBreak)
indent - the number of extra spaces to indent the annotations.descList - the array of AnnotationDesc.linkBreak - if true, add new line between each member value.
private java.lang.String annotationValueToString(AnnotationValue annotationValue)
public Configuration configuration()
configuration in class HtmlDocWriter
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||