public class Html
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
Html.ExternalJavadocsLinkMaker
|
static interface |
Html.LinkMaker
When generating HTML from JAVADOC, this interface is used to generate links to JAVA elements.
|
| Modifier and Type | Field and Description |
|---|---|
static Html.LinkMaker |
STANDARD_LINK_MAKER
Implements the strategy of the standard JAVADOC doclet.
|
| Constructor and Description |
|---|
Html(Html.LinkMaker linkMaker) |
| Modifier and Type | Method and Description |
|---|---|
static java.lang.String |
escapeSgmlEntities(java.lang.String text)
Replaces "
<", ">" and "&". |
protected java.lang.String |
expandTag(com.sun.javadoc.Doc ref,
com.sun.javadoc.RootDoc rootDoc,
java.lang.String tagName,
java.lang.String argument)
Expands a tag to HTML text.
|
java.lang.String |
fromJavadocText(java.lang.String s,
com.sun.javadoc.Doc ref,
com.sun.javadoc.RootDoc rootDoc)
Converts JAVADOC markup into HTML.
|
java.lang.String |
fromTags(com.sun.javadoc.Tag[] tags,
com.sun.javadoc.Doc ref,
com.sun.javadoc.RootDoc rootDoc)
Expands inline tags to HTML.
|
java.lang.String |
generateFor(com.sun.javadoc.Doc doc,
com.sun.javadoc.RootDoc rootDoc)
Generates HTML markup for the given
doc in the context of ref. |
static com.sun.javadoc.Doc |
hrefToDoc(java.lang.String href,
com.sun.javadoc.RootDoc rootDoc,
com.sun.javadoc.ClassDoc from) |
java.lang.String |
makeLink(com.sun.javadoc.Doc from,
com.sun.javadoc.Doc to,
boolean plain,
java.lang.String label,
java.lang.String target,
com.sun.javadoc.RootDoc rootDoc) |
java.lang.String |
makeLink(com.sun.javadoc.Doc from,
java.lang.String to,
boolean plain,
java.lang.String label,
com.sun.javadoc.RootDoc rootDoc)
Resolves a 'target specification' as in the "@link" tag.
|
java.lang.String |
optionalTag(com.sun.javadoc.Doc doc,
java.lang.String tagName,
com.sun.javadoc.RootDoc rootDoc)
Verifies that the named block tag exists at most once, replaces line breaks with spaces, and convert
its text to HTML.
|
java.lang.String |
optionalTag(com.sun.javadoc.Doc doc,
java.lang.String tagName,
java.lang.String defaulT,
com.sun.javadoc.RootDoc rootDoc)
Verifies that the named block tag exists at most once, replaces line breaks with spaces, and convert
its text to HTML.
|
public static final Html.LinkMaker STANDARD_LINK_MAKER
Hrefs are generated as follows:
"#toField""#ToClass(java.lang.String)""#toMethod(java.lang.String)""http://external.url/to/package/ToClass""http://external.url/to/package/ToClass#toField""http://external.url/to/package/ToClass#ToClass(java.lang.String)""http://external.url/to/package/ToClass#toMethod(java.lang.String)""ToClass""ToClass#toField""ToClass#ToClass(String)""ToClass#toMethod(String)""../../to/package/ToClass""../../to/package/ToClass#toField""../../to/package/ToClass#ToClass(String)""../../to/package/ToClass#toMethod(String)"nullDefault labels are generated as follows:
"toField""ToClass(java.lang.String)""toMethod(java.lang.String)"ToClassToClass.toFieldToClass(java.lang.String)ToClass.toMethod(java.lang.String)public Html(Html.LinkMaker linkMaker)
public java.lang.String fromTags(com.sun.javadoc.Tag[] tags,
com.sun.javadoc.Doc ref,
com.sun.javadoc.RootDoc rootDoc)
throws Longjump
{@code text}
{@docRoot}
{@inheritDoc}
{@link package.class#member label}
{@linkplain package.class#member label}
{@literal text}
{@value package.class#field}
Only part of these are currently acceptable for the transformation into HTML.Longjumppublic java.lang.String fromJavadocText(java.lang.String s,
com.sun.javadoc.Doc ref,
com.sun.javadoc.RootDoc rootDoc)
throws Longjump
ref - The 'current element'; relevant to resolve relative referencesrootDoc - Used to resolve absolute references and to print errors and warningsLongjumpprotected java.lang.String expandTag(com.sun.javadoc.Doc ref,
com.sun.javadoc.RootDoc rootDoc,
java.lang.String tagName,
@Nullable
java.lang.String argument)
throws Longjump
{@code text}{@value field-ref}{@link ref [ text ] }{@linkplain ref [ text ] }{@ link}, but in default fontSubclasses may override this method to expand more than these tags.
argument - The text between the tag name and the closing brace, not including any leading space, or
null iff there is no argumentLongjumppublic static com.sun.javadoc.Doc hrefToDoc(java.lang.String href,
com.sun.javadoc.RootDoc rootDoc,
com.sun.javadoc.ClassDoc from)
throws Longjump
href - A link like "../../pkg/MyClass#myMethod(java.lang.String)"from - The ClassDoc to which this link is relative tohref designatesLongjumppublic java.lang.String makeLink(com.sun.javadoc.Doc from,
java.lang.String to,
boolean plain,
@Nullable
java.lang.String label,
com.sun.javadoc.RootDoc rootDoc)
throws Longjump
Example return values are:
#myMethod<a href="#myMethod(java.lang.String)">myMethod(java.lang.String)</a>pkg.MyClass#myMethod(String)<a href="../pkg/MyClass#myMethod(java.lang.String)">MyClass.myMethod(java.lang.String)</a>java.net.Socket#close()<a href="http://docs.oracle.com/javase/7/docs/api/java/net/Socket.html#close()">Socket.close()</a>
org.apache.tools.ant.Task#execute()org.apache.tools.ant.Task.execute()from - The package, class or member currently being documented, or the rootDocto - E.g. "pkg.MyClass#myMethod(String)"plain - Whether this is a "@linkplain"label - The (optional) label to display in the linkLongjumppublic java.lang.String makeLink(com.sun.javadoc.Doc from,
com.sun.javadoc.Doc to,
boolean plain,
@Nullable
java.lang.String label,
@Nullable
java.lang.String target,
com.sun.javadoc.RootDoc rootDoc)
throws Longjump
plain - Whether this is a "@plainlink"target - The value of the (optional) 'target="..."' attribute of the HTML anchor<a href="#equals(java.lang.Object)">THE-LABEL</a>"Longjumppublic static java.lang.String escapeSgmlEntities(java.lang.String text)
<", ">" and "&".@Nullable public java.lang.String optionalTag(com.sun.javadoc.Doc doc, java.lang.String tagName, com.sun.javadoc.RootDoc rootDoc) throws Longjump
null iff the tag does not existLongjumppublic java.lang.String optionalTag(com.sun.javadoc.Doc doc,
java.lang.String tagName,
java.lang.String defaulT,
com.sun.javadoc.RootDoc rootDoc)
throws Longjump
Longjump