mirror of
https://github.com/openjdk/jdk.git
synced 2026-03-23 22:29:55 +00:00
8011651: simplify LinkInfoImpl API
Reviewed-by: darcy
This commit is contained in:
parent
f7e7f8d1bc
commit
c7eaca84da
@ -62,7 +62,7 @@ public abstract class AbstractExecutableMemberWriter extends AbstractMemberWrite
|
||||
*/
|
||||
protected int addTypeParameters(ExecutableMemberDoc member, Content htmltree) {
|
||||
LinkInfoImpl linkInfo = new LinkInfoImpl(configuration,
|
||||
LinkInfoImpl.Kind.MEMBER_TYPE_PARAMS, member, false);
|
||||
LinkInfoImpl.Kind.MEMBER_TYPE_PARAMS, member);
|
||||
Content typeParameters = writer.getTypeParameterLinks(linkInfo);
|
||||
if (linkInfo.displayLength > 0) {
|
||||
Content linkContent = typeParameters;
|
||||
@ -130,7 +130,7 @@ public abstract class AbstractExecutableMemberWriter extends AbstractMemberWrite
|
||||
if (param.type() != null) {
|
||||
Content link = writer.getLink(new LinkInfoImpl(
|
||||
configuration, LinkInfoImpl.Kind.EXECUTABLE_MEMBER_PARAM,
|
||||
param.type(), isVarArg));
|
||||
param.type()).varargs(isVarArg));
|
||||
tree.addContent(link);
|
||||
}
|
||||
if(param.name().length() > 0) {
|
||||
@ -244,7 +244,7 @@ public abstract class AbstractExecutableMemberWriter extends AbstractMemberWrite
|
||||
Type[] exceptions = member.thrownExceptionTypes();
|
||||
if(exceptions.length > 0) {
|
||||
LinkInfoImpl memberTypeParam = new LinkInfoImpl(configuration,
|
||||
LinkInfoImpl.Kind.MEMBER, member, false);
|
||||
LinkInfoImpl.Kind.MEMBER, member);
|
||||
int retlen = getReturnTypeLength(member);
|
||||
writer.getTypeParameterLinks(memberTypeParam);
|
||||
retlen += memberTypeParam.displayLength == 0 ?
|
||||
|
||||
@ -140,7 +140,7 @@ public class AbstractIndexWriter extends HtmlDocletWriter {
|
||||
*/
|
||||
protected void addDescription(ClassDoc cd, Content dlTree) {
|
||||
Content link = getLink(new LinkInfoImpl(configuration,
|
||||
LinkInfoImpl.Kind.INDEX, cd, true));
|
||||
LinkInfoImpl.Kind.INDEX, cd).strong(true));
|
||||
Content dt = HtmlTree.DT(link);
|
||||
dt.addContent(" - ");
|
||||
addClassInfo(cd, dt);
|
||||
|
||||
@ -160,9 +160,9 @@ public class AllClassesFrameWriter extends HtmlDocletWriter {
|
||||
Content linkContent;
|
||||
if (wantFrames) {
|
||||
linkContent = getLink(new LinkInfoImpl(configuration,
|
||||
LinkInfoImpl.Kind.ALL_CLASSES_FRAME, cd, label, "classFrame"));
|
||||
LinkInfoImpl.Kind.ALL_CLASSES_FRAME, cd).label(label).target("classFrame"));
|
||||
} else {
|
||||
linkContent = getLink(new LinkInfoImpl(configuration, cd, label));
|
||||
linkContent = getLink(new LinkInfoImpl(configuration, LinkInfoImpl.Kind.DEFAULT, cd).label(label));
|
||||
}
|
||||
Content li = HtmlTree.LI(linkContent);
|
||||
content.addContent(li);
|
||||
|
||||
@ -117,8 +117,8 @@ public class AnnotationTypeWriterImpl extends SubWriterHolderWriter
|
||||
Content li;
|
||||
if (prev != null) {
|
||||
Content prevLink = getLink(new LinkInfoImpl(configuration,
|
||||
LinkInfoImpl.Kind.CLASS, prev.asClassDoc(), "",
|
||||
configuration.getText("doclet.Prev_Class"), true));
|
||||
LinkInfoImpl.Kind.CLASS, prev.asClassDoc())
|
||||
.label(configuration.getText("doclet.Prev_Class")).strong(true));
|
||||
li = HtmlTree.LI(prevLink);
|
||||
}
|
||||
else
|
||||
@ -135,8 +135,8 @@ public class AnnotationTypeWriterImpl extends SubWriterHolderWriter
|
||||
Content li;
|
||||
if (next != null) {
|
||||
Content nextLink = getLink(new LinkInfoImpl(configuration,
|
||||
LinkInfoImpl.Kind.CLASS, next.asClassDoc(), "",
|
||||
configuration.getText("doclet.Next_Class"), true));
|
||||
LinkInfoImpl.Kind.CLASS, next.asClassDoc())
|
||||
.label(configuration.getText("doclet.Next_Class")).strong(true));
|
||||
li = HtmlTree.LI(nextLink);
|
||||
}
|
||||
else
|
||||
@ -163,7 +163,7 @@ public class AnnotationTypeWriterImpl extends SubWriterHolderWriter
|
||||
div.addContent(pkgNameDiv);
|
||||
}
|
||||
LinkInfoImpl linkInfo = new LinkInfoImpl(configuration,
|
||||
LinkInfoImpl.Kind.CLASS_HEADER, annotationType, false);
|
||||
LinkInfoImpl.Kind.CLASS_HEADER, annotationType);
|
||||
Content headerContent = new StringContent(header);
|
||||
Content heading = HtmlTree.HEADING(HtmlConstants.CLASS_PAGE_HEADING, true,
|
||||
HtmlStyle.title, headerContent);
|
||||
@ -220,7 +220,7 @@ public class AnnotationTypeWriterImpl extends SubWriterHolderWriter
|
||||
addAnnotationInfo(annotationType, pre);
|
||||
pre.addContent(modifiers);
|
||||
LinkInfoImpl linkInfo = new LinkInfoImpl(configuration,
|
||||
LinkInfoImpl.Kind.CLASS_SIGNATURE, annotationType, false);
|
||||
LinkInfoImpl.Kind.CLASS_SIGNATURE, annotationType);
|
||||
Content annotationName = new StringContent(annotationType.name());
|
||||
Content parameterLinks = getTypeParameterLinks(linkInfo);
|
||||
if (configuration.linksource) {
|
||||
|
||||
@ -258,8 +258,8 @@ public class ClassUseWriter extends SubWriterHolderWriter {
|
||||
Content table = HtmlTree.TABLE(0, 3, 0, useTableSummary,
|
||||
getTableCaption(configuration.getText(
|
||||
"doclet.ClassUse_Packages.that.use.0",
|
||||
getLink(new LinkInfoImpl(configuration, LinkInfoImpl.Kind.CLASS_USE_HEADER, classdoc,
|
||||
false)).toString())));
|
||||
getLink(new LinkInfoImpl(configuration, LinkInfoImpl.Kind.CLASS_USE_HEADER, classdoc
|
||||
)).toString())));
|
||||
table.addContent(getSummaryTableHeader(packageTableHeader, "col"));
|
||||
Content tbody = new HtmlTree(HtmlTag.TBODY);
|
||||
Iterator<PackageDoc> it = pkgSet.iterator();
|
||||
@ -294,7 +294,7 @@ public class ClassUseWriter extends SubWriterHolderWriter {
|
||||
getTableCaption(configuration.getText(
|
||||
"doclet.ClassUse_PackageAnnotation",
|
||||
getLink(new LinkInfoImpl(configuration,
|
||||
LinkInfoImpl.Kind.CLASS_USE_HEADER, classdoc, false)).toString())));
|
||||
LinkInfoImpl.Kind.CLASS_USE_HEADER, classdoc)).toString())));
|
||||
table.addContent(getSummaryTableHeader(packageTableHeader, "col"));
|
||||
Content tbody = new HtmlTree(HtmlTag.TBODY);
|
||||
Iterator<PackageDoc> it = pkgToPackageAnnotations.iterator();
|
||||
@ -334,7 +334,7 @@ public class ClassUseWriter extends SubWriterHolderWriter {
|
||||
Content link = new RawHtml(
|
||||
configuration.getText("doclet.ClassUse_Uses.of.0.in.1",
|
||||
getLink(new LinkInfoImpl(configuration, LinkInfoImpl.Kind.CLASS_USE_HEADER,
|
||||
classdoc, false)).toString(),
|
||||
classdoc)).toString(),
|
||||
getPackageLinkString(pkg, Util.escapeHtmlChars(Util.getPackageName(pkg)), false)));
|
||||
Content heading = HtmlTree.HEADING(HtmlConstants.SUMMARY_HEADING, link);
|
||||
li.addContent(heading);
|
||||
@ -369,7 +369,7 @@ public class ClassUseWriter extends SubWriterHolderWriter {
|
||||
*/
|
||||
protected void addClassUse(PackageDoc pkg, Content contentTree) throws IOException {
|
||||
String classLink = getLink(new LinkInfoImpl(configuration,
|
||||
LinkInfoImpl.Kind.CLASS_USE_HEADER, classdoc, false)).toString();
|
||||
LinkInfoImpl.Kind.CLASS_USE_HEADER, classdoc)).toString();
|
||||
String pkgLink = getPackageLinkString(pkg, Util.escapeHtmlChars(Util.getPackageName(pkg)), false);
|
||||
classSubWriter.addUseInfo(pkgToClassAnnotations.get(pkg.name()),
|
||||
configuration.getText("doclet.ClassUse_Annotation", classLink,
|
||||
@ -477,8 +477,8 @@ public class ClassUseWriter extends SubWriterHolderWriter {
|
||||
*/
|
||||
protected Content getNavLinkClass() {
|
||||
Content linkContent = getLink(new LinkInfoImpl(
|
||||
configuration, LinkInfoImpl.Kind.CLASS_USE_HEADER, classdoc,
|
||||
"", configuration.getText("doclet.Class"), false));
|
||||
configuration, LinkInfoImpl.Kind.CLASS_USE_HEADER, classdoc)
|
||||
.label(configuration.getText("doclet.Class")));
|
||||
Content li = HtmlTree.LI(linkContent);
|
||||
return li;
|
||||
}
|
||||
|
||||
@ -125,8 +125,8 @@ public class ClassWriterImpl extends SubWriterHolderWriter
|
||||
Content li;
|
||||
if (prev != null) {
|
||||
Content prevLink = getLink(new LinkInfoImpl(configuration,
|
||||
LinkInfoImpl.Kind.CLASS, prev, "",
|
||||
configuration.getText("doclet.Prev_Class"), true));
|
||||
LinkInfoImpl.Kind.CLASS, prev)
|
||||
.label(configuration.getText("doclet.Prev_Class")).strong(true));
|
||||
li = HtmlTree.LI(prevLink);
|
||||
}
|
||||
else
|
||||
@ -143,8 +143,8 @@ public class ClassWriterImpl extends SubWriterHolderWriter
|
||||
Content li;
|
||||
if (next != null) {
|
||||
Content nextLink = getLink(new LinkInfoImpl(configuration,
|
||||
LinkInfoImpl.Kind.CLASS, next, "",
|
||||
configuration.getText("doclet.Next_Class"), true));
|
||||
LinkInfoImpl.Kind.CLASS, next)
|
||||
.label(configuration.getText("doclet.Next_Class")).strong(true));
|
||||
li = HtmlTree.LI(nextLink);
|
||||
}
|
||||
else
|
||||
@ -185,7 +185,7 @@ public class ClassWriterImpl extends SubWriterHolderWriter
|
||||
div.addContent(pkgNameDiv);
|
||||
}
|
||||
LinkInfoImpl linkInfo = new LinkInfoImpl(configuration,
|
||||
LinkInfoImpl.Kind.CLASS_HEADER, classDoc, false);
|
||||
LinkInfoImpl.Kind.CLASS_HEADER, classDoc);
|
||||
//Let's not link to ourselves in the header.
|
||||
linkInfo.linkToSelf = false;
|
||||
Content headerContent = new StringContent(header);
|
||||
@ -245,7 +245,7 @@ public class ClassWriterImpl extends SubWriterHolderWriter
|
||||
addAnnotationInfo(classDoc, pre);
|
||||
pre.addContent(modifiers);
|
||||
LinkInfoImpl linkInfo = new LinkInfoImpl(configuration,
|
||||
LinkInfoImpl.Kind.CLASS_SIGNATURE, classDoc, false);
|
||||
LinkInfoImpl.Kind.CLASS_SIGNATURE, classDoc);
|
||||
//Let's not link to ourselves in the signature.
|
||||
linkInfo.linkToSelf = false;
|
||||
Content className = new StringContent(classDoc.name());
|
||||
@ -362,7 +362,7 @@ public class ClassWriterImpl extends SubWriterHolderWriter
|
||||
if (type.equals(classDoc)) {
|
||||
Content typeParameters = getTypeParameterLinks(
|
||||
new LinkInfoImpl(configuration, LinkInfoImpl.Kind.TREE,
|
||||
classDoc, false));
|
||||
classDoc));
|
||||
if (configuration.shouldExcludeQualifier(
|
||||
classDoc.containingPackage().name())) {
|
||||
li.addContent(type.asClassDoc().name());
|
||||
@ -373,9 +373,8 @@ public class ClassWriterImpl extends SubWriterHolderWriter
|
||||
}
|
||||
} else {
|
||||
Content link = getLink(new LinkInfoImpl(configuration,
|
||||
LinkInfoImpl.Kind.CLASS_TREE_PARENT,
|
||||
type instanceof ClassDoc ? (ClassDoc) type : type,
|
||||
configuration.getClassName(type.asClassDoc()), false));
|
||||
LinkInfoImpl.Kind.CLASS_TREE_PARENT, type)
|
||||
.label(configuration.getClassName(type.asClassDoc())));
|
||||
li.addContent(link);
|
||||
}
|
||||
return li;
|
||||
@ -521,7 +520,7 @@ public class ClassWriterImpl extends SubWriterHolderWriter
|
||||
Content dl = HtmlTree.DL(dt);
|
||||
Content dd = new HtmlTree(HtmlTag.DD);
|
||||
dd.addContent(getLink(new LinkInfoImpl(configuration,
|
||||
LinkInfoImpl.Kind.CLASS, outerClass, false)));
|
||||
LinkInfoImpl.Kind.CLASS, outerClass)));
|
||||
dl.addContent(dd);
|
||||
classInfoTree.addContent(dl);
|
||||
}
|
||||
|
||||
@ -186,7 +186,7 @@ public class ConstantsSummaryWriterImpl extends HtmlDocletWriter
|
||||
//generate links backward only to public classes.
|
||||
String classlink = (cd.isPublic() || cd.isProtected()) ?
|
||||
getLink(new LinkInfoImpl(configuration,
|
||||
LinkInfoImpl.Kind.CONSTANT_SUMMARY, cd, false)).toString() :
|
||||
LinkInfoImpl.Kind.CONSTANT_SUMMARY, cd)).toString() :
|
||||
cd.qualifiedName();
|
||||
String name = cd.containingPackage().name();
|
||||
if (name.length() > 0) {
|
||||
|
||||
@ -373,8 +373,7 @@ public class HtmlDocletWriter extends HtmlDocWriter {
|
||||
continue;
|
||||
}
|
||||
Content classContent = getLink(new LinkInfoImpl(
|
||||
configuration, LinkInfoImpl.Kind.PACKAGE, classes[i],
|
||||
false));
|
||||
configuration, LinkInfoImpl.Kind.PACKAGE, classes[i]));
|
||||
Content tdClass = HtmlTree.TD(HtmlStyle.colFirst, classContent);
|
||||
HtmlTree tr = HtmlTree.TR(tdClass);
|
||||
if (i%2 == 0)
|
||||
@ -1192,8 +1191,8 @@ public class HtmlDocletWriter extends HtmlDocWriter {
|
||||
* @return a content tree for the link
|
||||
*/
|
||||
public Content getQualifiedClassLink(LinkInfoImpl.Kind context, ClassDoc cd) {
|
||||
return getLink(new LinkInfoImpl(configuration, context, cd,
|
||||
new StringContent(configuration.getClassName(cd)), ""));
|
||||
return getLink(new LinkInfoImpl(configuration, context, cd)
|
||||
.label(configuration.getClassName(cd)));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1224,7 +1223,7 @@ public class HtmlDocletWriter extends HtmlDocWriter {
|
||||
classlink.addContent(getPkgName(cd));
|
||||
}
|
||||
classlink.addContent(getLink(new LinkInfoImpl(configuration,
|
||||
context, cd, cd.name(), isStrong)));
|
||||
context, cd).label(cd.name()).strong(isStrong)));
|
||||
return classlink;
|
||||
}
|
||||
|
||||
@ -1245,7 +1244,7 @@ public class HtmlDocletWriter extends HtmlDocWriter {
|
||||
contentTree.addContent(getPkgName(cd));
|
||||
}
|
||||
contentTree.addContent(getLink(new LinkInfoImpl(configuration,
|
||||
context, cd, cd.name(), isStrong)));
|
||||
context, cd).label(cd.name()).strong(isStrong)));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1329,11 +1328,11 @@ public class HtmlDocletWriter extends HtmlDocWriter {
|
||||
return label;
|
||||
} else if (doc instanceof ExecutableMemberDoc) {
|
||||
ExecutableMemberDoc emd = (ExecutableMemberDoc)doc;
|
||||
return getLink(new LinkInfoImpl(configuration, context, classDoc,
|
||||
getAnchor(emd, isProperty), label, strong));
|
||||
return getLink(new LinkInfoImpl(configuration, context, classDoc)
|
||||
.label(label).where(getAnchor(emd, isProperty)).strong(strong));
|
||||
} else if (doc instanceof MemberDoc) {
|
||||
return getLink(new LinkInfoImpl(configuration, context, classDoc,
|
||||
doc.name(), label, strong));
|
||||
return getLink(new LinkInfoImpl(configuration, context, classDoc)
|
||||
.label(label).where(doc.name()).strong(strong));
|
||||
} else {
|
||||
return label;
|
||||
}
|
||||
@ -1356,12 +1355,12 @@ public class HtmlDocletWriter extends HtmlDocWriter {
|
||||
Util.isLinkable(classDoc, configuration))) {
|
||||
return label;
|
||||
} else if (doc instanceof ExecutableMemberDoc) {
|
||||
ExecutableMemberDoc emd = (ExecutableMemberDoc)doc;
|
||||
return getLink(new LinkInfoImpl(configuration, context, classDoc,
|
||||
getAnchor(emd), label, false));
|
||||
ExecutableMemberDoc emd = (ExecutableMemberDoc) doc;
|
||||
return getLink(new LinkInfoImpl(configuration, context, classDoc)
|
||||
.label(label).where(getAnchor(emd)));
|
||||
} else if (doc instanceof MemberDoc) {
|
||||
return getLink(new LinkInfoImpl(configuration, context, classDoc,
|
||||
doc.name(), label, false));
|
||||
return getLink(new LinkInfoImpl(configuration, context, classDoc)
|
||||
.label(label).where(doc.name()));
|
||||
} else {
|
||||
return label;
|
||||
}
|
||||
@ -1447,7 +1446,8 @@ public class HtmlDocletWriter extends HtmlDocWriter {
|
||||
if (label.isEmpty()) {
|
||||
label = plainOrCode(plain, new StringContent(refClass.name()));
|
||||
}
|
||||
return getLink(new LinkInfoImpl(configuration, refClass, label)).toString();
|
||||
return getLink(new LinkInfoImpl(configuration, LinkInfoImpl.Kind.DEFAULT, refClass)
|
||||
.label(label)).toString();
|
||||
} else if (refMem == null) {
|
||||
// Must be a member reference since refClass is not null and refMemName is not null.
|
||||
// However, refMem is null, so this referenced member does not exist.
|
||||
|
||||
@ -237,16 +237,13 @@ public class LinkInfoImpl extends LinkInfo {
|
||||
*
|
||||
* @param configuration the configuration data for the doclet
|
||||
* @param context the context of the link.
|
||||
* @param classDoc the class to link to.
|
||||
* @param label the label for the link.
|
||||
* @param target the value of the target attribute.
|
||||
* @param context the context of the link.
|
||||
* @param executableMemberDoc the member to link to.
|
||||
*/
|
||||
public LinkInfoImpl(ConfigurationImpl configuration,
|
||||
Kind context, ClassDoc classDoc, Content label, String target) {
|
||||
Kind context, ExecutableMemberDoc executableMemberDoc) {
|
||||
this.configuration = configuration;
|
||||
this.classDoc = classDoc;
|
||||
this.label = label;
|
||||
this.target = target;
|
||||
this.executableMemberDoc = executableMemberDoc;
|
||||
setContext(context);
|
||||
}
|
||||
|
||||
@ -263,117 +260,11 @@ public class LinkInfoImpl extends LinkInfo {
|
||||
* @param configuration the configuration data for the doclet
|
||||
* @param context the context of the link.
|
||||
* @param classDoc the class to link to.
|
||||
* @param where the value of the marker #.
|
||||
* @param label the label for the link.
|
||||
* @param isStrong true if the link should be strong.
|
||||
* @param styleName String style of text defined in style sheet.
|
||||
*/
|
||||
public LinkInfoImpl(ConfigurationImpl configuration,
|
||||
Kind context, ClassDoc classDoc, String where, Content label,
|
||||
boolean isStrong, String styleName) {
|
||||
Kind context, ClassDoc classDoc) {
|
||||
this.configuration = configuration;
|
||||
this.classDoc = classDoc;
|
||||
this.where = where;
|
||||
this.label = label;
|
||||
this.isStrong = isStrong;
|
||||
this.styleName = styleName;
|
||||
setContext(context);
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct a LinkInfo object.
|
||||
*
|
||||
* @param configuration the configuration data for the doclet
|
||||
* @param context the context of the link.
|
||||
* @param classDoc the class to link to.
|
||||
* @param where the value of the marker #.
|
||||
* @param label the plain-text label for the link.
|
||||
* @param isStrong true if the link should be strong.
|
||||
*/
|
||||
public LinkInfoImpl(ConfigurationImpl configuration,
|
||||
Kind context, ClassDoc classDoc, String where, String label,
|
||||
boolean isStrong) {
|
||||
this(configuration, context, classDoc, where, new StringContent(label),
|
||||
isStrong, "");
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct a LinkInfo object.
|
||||
*
|
||||
* @param configuration the configuration data for the doclet
|
||||
* @param context the context of the link.
|
||||
* @param classDoc the class to link to.
|
||||
* @param where the value of the marker #.
|
||||
* @param label the label for the link.
|
||||
* @param isStrong true if the link should be strong.
|
||||
*/
|
||||
public LinkInfoImpl(ConfigurationImpl configuration,
|
||||
Kind context, ClassDoc classDoc, String where, Content label,
|
||||
boolean isStrong) {
|
||||
this(configuration, context, classDoc, where, label,
|
||||
isStrong, "");
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct a LinkInfo object.
|
||||
*
|
||||
* @param configuration the configuration data for the doclet
|
||||
* @param classDoc the class to link to.
|
||||
* @param label the label for the link.
|
||||
*/
|
||||
public LinkInfoImpl(ConfigurationImpl configuration,
|
||||
ClassDoc classDoc, Content label) {
|
||||
this.configuration = configuration;
|
||||
this.classDoc = classDoc;
|
||||
this.label = label;
|
||||
setContext(context);
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct a LinkInfo object.
|
||||
*
|
||||
* @param configuration the configuration data for the doclet
|
||||
* @param classDoc the class to link to.
|
||||
* @param label the label for the link.
|
||||
*/
|
||||
public LinkInfoImpl(ConfigurationImpl configuration,
|
||||
ClassDoc classDoc, String label) {
|
||||
this.configuration = configuration;
|
||||
this.classDoc = classDoc;
|
||||
this.label = new StringContent(label);
|
||||
setContext(context);
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct a LinkInfo object.
|
||||
*
|
||||
* @param configuration the configuration data for the doclet
|
||||
* @param context the context of the link.
|
||||
* @param executableMemberDoc the member to link to.
|
||||
* @param isStrong true if the link should be strong.
|
||||
*/
|
||||
public LinkInfoImpl(ConfigurationImpl configuration,
|
||||
Kind context, ExecutableMemberDoc executableMemberDoc,
|
||||
boolean isStrong) {
|
||||
this.configuration = configuration;
|
||||
this.executableMemberDoc = executableMemberDoc;
|
||||
this.isStrong = isStrong;
|
||||
setContext(context);
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct a LinkInfo object.
|
||||
*
|
||||
* @param configuration the configuration data for the doclet
|
||||
* @param context the context of the link.
|
||||
* @param classDoc the class to link to.
|
||||
* @param isStrong true if the link should be strong.
|
||||
*/
|
||||
public LinkInfoImpl(ConfigurationImpl configuration,
|
||||
Kind context, ClassDoc classDoc, boolean isStrong) {
|
||||
this.configuration = configuration;
|
||||
this.classDoc = classDoc;
|
||||
this.isStrong = isStrong;
|
||||
setContext(context);
|
||||
}
|
||||
|
||||
@ -391,90 +282,66 @@ public class LinkInfoImpl extends LinkInfo {
|
||||
setContext(context);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Construct a LinkInfo object.
|
||||
*
|
||||
* @param configuration the configuration data for the doclet
|
||||
* @param context the context of the link.
|
||||
* @param type the class to link to.
|
||||
* @param isVarArg true if this is a link to a var arg.
|
||||
* Set the label for the link.
|
||||
* @param label plain-text label for the link
|
||||
*/
|
||||
public LinkInfoImpl(ConfigurationImpl configuration,
|
||||
Kind context, Type type, boolean isVarArg) {
|
||||
this.configuration = configuration;
|
||||
this.type = type;
|
||||
this.isVarArg = isVarArg;
|
||||
setContext(context);
|
||||
public LinkInfoImpl label(String label) {
|
||||
this.label = new StringContent(label);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct a LinkInfo object.
|
||||
*
|
||||
* @param configuration the configuration data for the doclet
|
||||
* @param context the context of the link.
|
||||
* @param type the class to link to.
|
||||
* @param label plain-text label for the link.
|
||||
* @param isStrong true if the link should be strong.
|
||||
* Set the label for the link.
|
||||
*/
|
||||
public LinkInfoImpl(ConfigurationImpl configuration,
|
||||
Kind context, Type type, String label,
|
||||
boolean isStrong) {
|
||||
this(configuration, context, type, new StringContent(label), isStrong);
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct a LinkInfo object.
|
||||
*
|
||||
* @param configuration the configuration data for the doclet
|
||||
* @param context the context of the link.
|
||||
* @param type the class to link to.
|
||||
* @param label the label for the link.
|
||||
* @param isStrong true if the link should be strong.
|
||||
*/
|
||||
public LinkInfoImpl(ConfigurationImpl configuration,
|
||||
Kind context, Type type, Content label,
|
||||
boolean isStrong) {
|
||||
this.configuration = configuration;
|
||||
this.type = type;
|
||||
public LinkInfoImpl label(Content label) {
|
||||
this.label = label;
|
||||
this.isStrong = isStrong;
|
||||
setContext(context);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct a LinkInfo object.
|
||||
*
|
||||
* @param configuration the configuration data for the doclet
|
||||
* @param context the context of the link.
|
||||
* @param classDoc the class to link to.
|
||||
* @param label plain-text label for the link.
|
||||
* @param isStrong true if the link should be strong.
|
||||
* Set whether or not the link should be strong.
|
||||
*/
|
||||
public LinkInfoImpl(ConfigurationImpl configuration,
|
||||
Kind context, ClassDoc classDoc, String label,
|
||||
boolean isStrong) {
|
||||
this(configuration, context, classDoc, new StringContent(label), isStrong);
|
||||
public LinkInfoImpl strong(boolean strong) {
|
||||
this.isStrong = strong;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct a LinkInfo object.
|
||||
*
|
||||
* @param configuration the configuration data for the doclet
|
||||
* @param context the context of the link.
|
||||
* @param classDoc the class to link to.
|
||||
* @param label the label for the link.
|
||||
* @param isStrong true if the link should be strong.
|
||||
* Set the style to be used for the link.
|
||||
* @param styleName String style of text defined in style sheet.
|
||||
*/
|
||||
public LinkInfoImpl(ConfigurationImpl configuration,
|
||||
Kind context, ClassDoc classDoc, Content label,
|
||||
boolean isStrong) {
|
||||
this.configuration = configuration;
|
||||
this.classDoc = classDoc;
|
||||
this.label = label;
|
||||
this.isStrong = isStrong;
|
||||
setContext(context);
|
||||
public LinkInfoImpl styleName(String styleName) {
|
||||
this.styleName = styleName;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the target to be used for the link.
|
||||
* @param styleName String style of text defined in style sheet.
|
||||
*/
|
||||
public LinkInfoImpl target(String target) {
|
||||
this.target = target;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set whether or not this is a link to a varargs parameter.
|
||||
*/
|
||||
public LinkInfoImpl varargs(boolean varargs) {
|
||||
this.isVarArg = varargs;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the fragment specifier for the link.
|
||||
*/
|
||||
public LinkInfoImpl where(String where) {
|
||||
this.where = where;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@ -546,7 +413,7 @@ public class LinkInfoImpl extends LinkInfo {
|
||||
context = c;
|
||||
if (type != null &&
|
||||
type.asTypeVariable()!= null &&
|
||||
type.asTypeVariable().owner() instanceof ExecutableMemberDoc){
|
||||
type.asTypeVariable().owner() instanceof ExecutableMemberDoc) {
|
||||
excludeTypeParameterLinks = true;
|
||||
}
|
||||
}
|
||||
|
||||
@ -317,8 +317,8 @@ public class MethodWriterImpl extends AbstractExecutableMemberWriter
|
||||
String name = method.name();
|
||||
Content methlink = writer.getLink(
|
||||
new LinkInfoImpl(writer.configuration, LinkInfoImpl.Kind.MEMBER,
|
||||
overriddenType.asClassDoc(),
|
||||
writer.getAnchor(method), name, false));
|
||||
overriddenType.asClassDoc())
|
||||
.where(writer.getAnchor(method)).label(name));
|
||||
Content codeMethLink = HtmlTree.CODE(methlink);
|
||||
Content dd = HtmlTree.DD(codeMethLink);
|
||||
dd.addContent(writer.getSpace());
|
||||
|
||||
@ -165,7 +165,7 @@ public class NestedClassWriterImpl extends AbstractMemberWriter
|
||||
protected void addSummaryLink(LinkInfoImpl.Kind context, ClassDoc cd, ProgramElementDoc member,
|
||||
Content tdSummary) {
|
||||
Content strong = HtmlTree.STRONG(
|
||||
writer.getLink(new LinkInfoImpl(configuration, context, (ClassDoc)member, false)));
|
||||
writer.getLink(new LinkInfoImpl(configuration, context, (ClassDoc)member)));
|
||||
Content code = HtmlTree.CODE(strong);
|
||||
tdSummary.addContent(code);
|
||||
}
|
||||
@ -177,7 +177,7 @@ public class NestedClassWriterImpl extends AbstractMemberWriter
|
||||
ProgramElementDoc member, Content linksTree) {
|
||||
linksTree.addContent(
|
||||
writer.getLink(new LinkInfoImpl(configuration, LinkInfoImpl.Kind.MEMBER,
|
||||
(ClassDoc)member, false)));
|
||||
(ClassDoc)member)));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -185,7 +185,7 @@ public class PackageFrameWriter extends HtmlDocletWriter {
|
||||
Content arr_i_name = new StringContent(arr[i].name());
|
||||
if (arr[i].isInterface()) arr_i_name = HtmlTree.I(arr_i_name);
|
||||
Content link = getLink(new LinkInfoImpl(configuration,
|
||||
LinkInfoImpl.Kind.PACKAGE_FRAME, arr[i], arr_i_name, "classFrame"));
|
||||
LinkInfoImpl.Kind.PACKAGE_FRAME, arr[i]).label(arr_i_name).target("classFrame"));
|
||||
Content li = HtmlTree.LI(link);
|
||||
ul.addContent(li);
|
||||
}
|
||||
|
||||
@ -179,8 +179,7 @@ public class PackageWriterImpl extends HtmlDocletWriter
|
||||
continue;
|
||||
}
|
||||
Content classContent = getLink(new LinkInfoImpl(
|
||||
configuration, LinkInfoImpl.Kind.PACKAGE, classes[i],
|
||||
false));
|
||||
configuration, LinkInfoImpl.Kind.PACKAGE, classes[i]));
|
||||
Content tdClass = HtmlTree.TD(HtmlStyle.colFirst, classContent);
|
||||
HtmlTree tr = HtmlTree.TR(tdClass);
|
||||
if (i%2 == 0)
|
||||
|
||||
@ -176,7 +176,7 @@ public class ProfilePackageFrameWriter extends HtmlDocletWriter {
|
||||
Content arr_i_name = new StringContent(arr[i].name());
|
||||
if (arr[i].isInterface()) arr_i_name = HtmlTree.I(arr_i_name);
|
||||
Content link = getLink(new LinkInfoImpl(configuration,
|
||||
LinkInfoImpl.Kind.PACKAGE_FRAME, arr[i], arr_i_name, "classFrame"));
|
||||
LinkInfoImpl.Kind.PACKAGE_FRAME, arr[i]).label(arr_i_name).target("classFrame"));
|
||||
Content li = HtmlTree.LI(link);
|
||||
ul.addContent(li);
|
||||
}
|
||||
|
||||
@ -128,8 +128,8 @@ public class SerializedFormWriterImpl extends SubWriterHolderWriter
|
||||
*/
|
||||
public Content getClassHeader(ClassDoc classDoc) {
|
||||
Content classLink = (classDoc.isPublic() || classDoc.isProtected()) ?
|
||||
getLink(new LinkInfoImpl(configuration, classDoc,
|
||||
configuration.getClassName(classDoc))) :
|
||||
getLink(new LinkInfoImpl(configuration, LinkInfoImpl.Kind.DEFAULT, classDoc)
|
||||
.label(configuration.getClassName(classDoc))) :
|
||||
new StringContent(classDoc.qualifiedName());
|
||||
Content li = HtmlTree.LI(HtmlStyle.blockList, getMarkerAnchor(
|
||||
classDoc.qualifiedName()));
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user