8010440: Replace int constants in LinkInfoImpl with enum

Reviewed-by: bpatel, darcy
This commit is contained in:
Jonathan Gibbons 2013-05-14 10:14:51 -07:00
parent 921bd43131
commit f2f747f475
25 changed files with 290 additions and 301 deletions

View File

@ -62,7 +62,7 @@ public abstract class AbstractExecutableMemberWriter extends AbstractMemberWrite
*/ */
protected int addTypeParameters(ExecutableMemberDoc member, Content htmltree) { protected int addTypeParameters(ExecutableMemberDoc member, Content htmltree) {
LinkInfoImpl linkInfo = new LinkInfoImpl(configuration, LinkInfoImpl linkInfo = new LinkInfoImpl(configuration,
LinkInfoImpl.CONTEXT_MEMBER_TYPE_PARAMS, member, false); LinkInfoImpl.Kind.MEMBER_TYPE_PARAMS, member, false);
String typeParameters = writer.getTypeParameterLinks(linkInfo); String typeParameters = writer.getTypeParameterLinks(linkInfo);
if (linkInfo.displayLength > 0) { if (linkInfo.displayLength > 0) {
Content linkContent = new RawHtml(typeParameters); Content linkContent = new RawHtml(typeParameters);
@ -78,7 +78,7 @@ public abstract class AbstractExecutableMemberWriter extends AbstractMemberWrite
*/ */
protected Content getDeprecatedLink(ProgramElementDoc member) { protected Content getDeprecatedLink(ProgramElementDoc member) {
ExecutableMemberDoc emd = (ExecutableMemberDoc)member; ExecutableMemberDoc emd = (ExecutableMemberDoc)member;
return writer.getDocLink(LinkInfoImpl.CONTEXT_MEMBER, (MemberDoc) emd, return writer.getDocLink(LinkInfoImpl.Kind.MEMBER, (MemberDoc) emd,
emd.qualifiedName() + emd.flatSignature()); emd.qualifiedName() + emd.flatSignature());
} }
@ -90,7 +90,7 @@ public abstract class AbstractExecutableMemberWriter extends AbstractMemberWrite
* @param member the member being linked to * @param member the member being linked to
* @param tdSummary the content tree to which the link will be added * @param tdSummary the content tree to which the link will be added
*/ */
protected void addSummaryLink(int context, ClassDoc cd, ProgramElementDoc member, protected void addSummaryLink(LinkInfoImpl.Kind context, ClassDoc cd, ProgramElementDoc member,
Content tdSummary) { Content tdSummary) {
ExecutableMemberDoc emd = (ExecutableMemberDoc)member; ExecutableMemberDoc emd = (ExecutableMemberDoc)member;
String name = emd.name(); String name = emd.name();
@ -113,7 +113,7 @@ public abstract class AbstractExecutableMemberWriter extends AbstractMemberWrite
protected void addInheritedSummaryLink(ClassDoc cd, protected void addInheritedSummaryLink(ClassDoc cd,
ProgramElementDoc member, Content linksTree) { ProgramElementDoc member, Content linksTree) {
linksTree.addContent(new RawHtml( linksTree.addContent(new RawHtml(
writer.getDocLink(LinkInfoImpl.CONTEXT_MEMBER, cd, (MemberDoc) member, writer.getDocLink(LinkInfoImpl.Kind.MEMBER, cd, (MemberDoc) member,
member.name(), false))); member.name(), false)));
} }
@ -129,7 +129,7 @@ public abstract class AbstractExecutableMemberWriter extends AbstractMemberWrite
boolean isVarArg, Content tree) { boolean isVarArg, Content tree) {
if (param.type() != null) { if (param.type() != null) {
Content link = new RawHtml(writer.getLink(new LinkInfoImpl( Content link = new RawHtml(writer.getLink(new LinkInfoImpl(
configuration, LinkInfoImpl.CONTEXT_EXECUTABLE_MEMBER_PARAM, configuration, LinkInfoImpl.Kind.EXECUTABLE_MEMBER_PARAM,
param.type(), isVarArg))); param.type(), isVarArg)));
tree.addContent(link); tree.addContent(link);
} }
@ -153,7 +153,7 @@ public abstract class AbstractExecutableMemberWriter extends AbstractMemberWrite
tree.addContent(writer.getSpace()); tree.addContent(writer.getSpace());
tree.addContent(rcvrType.typeName()); tree.addContent(rcvrType.typeName());
LinkInfoImpl linkInfo = new LinkInfoImpl(configuration, LinkInfoImpl linkInfo = new LinkInfoImpl(configuration,
LinkInfoImpl.CONTEXT_CLASS_SIGNATURE, rcvrType); LinkInfoImpl.Kind.CLASS_SIGNATURE, rcvrType);
tree.addContent(new RawHtml(writer.getTypeParameterLinks(linkInfo))); tree.addContent(new RawHtml(writer.getTypeParameterLinks(linkInfo)));
tree.addContent(writer.getSpace()); tree.addContent(writer.getSpace());
tree.addContent("this"); tree.addContent("this");
@ -244,7 +244,7 @@ public abstract class AbstractExecutableMemberWriter extends AbstractMemberWrite
Type[] exceptions = member.thrownExceptionTypes(); Type[] exceptions = member.thrownExceptionTypes();
if(exceptions.length > 0) { if(exceptions.length > 0) {
LinkInfoImpl memberTypeParam = new LinkInfoImpl(configuration, LinkInfoImpl memberTypeParam = new LinkInfoImpl(configuration,
LinkInfoImpl.CONTEXT_MEMBER, member, false); LinkInfoImpl.Kind.MEMBER, member, false);
int retlen = getReturnTypeLength(member); int retlen = getReturnTypeLength(member);
writer.getTypeParameterLinks(memberTypeParam); writer.getTypeParameterLinks(memberTypeParam);
retlen += memberTypeParam.displayLength == 0 ? retlen += memberTypeParam.displayLength == 0 ?
@ -256,14 +256,14 @@ public abstract class AbstractExecutableMemberWriter extends AbstractMemberWrite
htmltree.addContent("throws "); htmltree.addContent("throws ");
indent += " "; indent += " ";
Content link = new RawHtml(writer.getLink(new LinkInfoImpl(configuration, Content link = new RawHtml(writer.getLink(new LinkInfoImpl(configuration,
LinkInfoImpl.CONTEXT_MEMBER, exceptions[0]))); LinkInfoImpl.Kind.MEMBER, exceptions[0])));
htmltree.addContent(link); htmltree.addContent(link);
for(int i = 1; i < exceptions.length; i++) { for(int i = 1; i < exceptions.length; i++) {
htmltree.addContent(","); htmltree.addContent(",");
htmltree.addContent(DocletConstants.NL); htmltree.addContent(DocletConstants.NL);
htmltree.addContent(indent); htmltree.addContent(indent);
Content exceptionLink = new RawHtml(writer.getLink(new LinkInfoImpl( Content exceptionLink = new RawHtml(writer.getLink(new LinkInfoImpl(
configuration, LinkInfoImpl.CONTEXT_MEMBER, exceptions[i]))); configuration, LinkInfoImpl.Kind.MEMBER, exceptions[i])));
htmltree.addContent(exceptionLink); htmltree.addContent(exceptionLink);
} }
} }
@ -278,7 +278,7 @@ public abstract class AbstractExecutableMemberWriter extends AbstractMemberWrite
rettype.dimension().length(); rettype.dimension().length();
} else { } else {
LinkInfoImpl linkInfo = new LinkInfoImpl(configuration, LinkInfoImpl linkInfo = new LinkInfoImpl(configuration,
LinkInfoImpl.CONTEXT_MEMBER, rettype); LinkInfoImpl.Kind.MEMBER, rettype);
writer.getLink(linkInfo); writer.getLink(linkInfo);
return linkInfo.displayLength; return linkInfo.displayLength;
} }

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -141,7 +141,7 @@ public class AbstractIndexWriter extends HtmlDocletWriter {
protected void addDescription(ClassDoc cd, Content dlTree) { protected void addDescription(ClassDoc cd, Content dlTree) {
Content link = new RawHtml( Content link = new RawHtml(
getLink(new LinkInfoImpl(configuration, getLink(new LinkInfoImpl(configuration,
LinkInfoImpl.CONTEXT_INDEX, cd, true))); LinkInfoImpl.Kind.INDEX, cd, true)));
Content dt = HtmlTree.DT(link); Content dt = HtmlTree.DT(link);
dt.addContent(" - "); dt.addContent(" - ");
addClassInfo(cd, dt); addClassInfo(cd, dt);
@ -152,7 +152,7 @@ public class AbstractIndexWriter extends HtmlDocletWriter {
} }
/** /**
* Add the classkind(class, interface, exception, error of the class * Add the classkind (class, interface, exception), error of the class
* passed. * passed.
* *
* @param cd the class being documented * @param cd the class being documented
@ -179,7 +179,7 @@ public class AbstractIndexWriter extends HtmlDocletWriter {
name = Util.escapeHtmlChars(name); name = Util.escapeHtmlChars(name);
} }
Content span = HtmlTree.SPAN(HtmlStyle.strong, Content span = HtmlTree.SPAN(HtmlStyle.strong,
getDocLink(LinkInfoImpl.CONTEXT_INDEX, member, name)); getDocLink(LinkInfoImpl.Kind.INDEX, member, name));
Content dt = HtmlTree.DT(span); Content dt = HtmlTree.DT(span);
dt.addContent(" - "); dt.addContent(" - ");
addMemberDesc(member, dt); addMemberDesc(member, dt);
@ -253,7 +253,7 @@ public class AbstractIndexWriter extends HtmlDocletWriter {
getResource("doclet.Method_in", classdesc)); getResource("doclet.Method_in", classdesc));
} }
} }
addPreQualifiedClassLink(LinkInfoImpl.CONTEXT_INDEX, containing, addPreQualifiedClassLink(LinkInfoImpl.Kind.INDEX, containing,
false, contentTree); false, contentTree);
} }
} }

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -143,7 +143,7 @@ public abstract class AbstractMemberWriter {
*/ */
protected void addSummaryLink(ClassDoc cd, ProgramElementDoc member, protected void addSummaryLink(ClassDoc cd, ProgramElementDoc member,
Content tdSummary) { Content tdSummary) {
addSummaryLink(LinkInfoImpl.CONTEXT_MEMBER, cd, member, tdSummary); addSummaryLink(LinkInfoImpl.Kind.MEMBER, cd, member, tdSummary);
} }
/** /**
@ -154,7 +154,7 @@ public abstract class AbstractMemberWriter {
* @param member the member to be documented * @param member the member to be documented
* @param tdSummary the content tree to which the summary link will be added * @param tdSummary the content tree to which the summary link will be added
*/ */
protected abstract void addSummaryLink(int context, protected abstract void addSummaryLink(LinkInfoImpl.Kind context,
ClassDoc cd, ProgramElementDoc member, Content tdSummary); ClassDoc cd, ProgramElementDoc member, Content tdSummary);
/** /**
@ -294,11 +294,11 @@ public abstract class AbstractMemberWriter {
} }
code.addContent(new RawHtml( code.addContent(new RawHtml(
writer.getLink(new LinkInfoImpl(configuration, writer.getLink(new LinkInfoImpl(configuration,
LinkInfoImpl.CONTEXT_SUMMARY_RETURN_TYPE, type)))); LinkInfoImpl.Kind.SUMMARY_RETURN_TYPE, type))));
} else { } else {
code.addContent(new RawHtml( code.addContent(new RawHtml(
writer.getLink(new LinkInfoImpl(configuration, writer.getLink(new LinkInfoImpl(configuration,
LinkInfoImpl.CONTEXT_SUMMARY_RETURN_TYPE, type)))); LinkInfoImpl.Kind.SUMMARY_RETURN_TYPE, type))));
} }
} }
@ -483,7 +483,7 @@ public abstract class AbstractMemberWriter {
tdLast.addContent(name); tdLast.addContent(name);
} }
addSummaryLink(pgmdoc instanceof ClassDoc ? addSummaryLink(pgmdoc instanceof ClassDoc ?
LinkInfoImpl.CONTEXT_CLASS_USE : LinkInfoImpl.CONTEXT_MEMBER, LinkInfoImpl.Kind.CLASS_USE : LinkInfoImpl.Kind.MEMBER,
cd, pgmdoc, tdLast); cd, pgmdoc, tdLast);
writer.addSummaryLinkComment(this, pgmdoc, tdLast); writer.addSummaryLinkComment(this, pgmdoc, tdLast);
tr.addContent(tdLast); tr.addContent(tdLast);

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -152,7 +152,7 @@ public abstract class AbstractTreeWriter extends HtmlDocletWriter {
} else { } else {
contentTree.addContent(", "); contentTree.addContent(", ");
} }
addPreQualifiedClassLink(LinkInfoImpl.CONTEXT_TREE, addPreQualifiedClassLink(LinkInfoImpl.Kind.TREE,
interfaces[i], contentTree); interfaces[i], contentTree);
counter++; counter++;
} }
@ -170,7 +170,7 @@ public abstract class AbstractTreeWriter extends HtmlDocletWriter {
* @param contentTree the content tree to which the information will be added * @param contentTree the content tree to which the information will be added
*/ */
protected void addPartialInfo(ClassDoc cd, Content contentTree) { protected void addPartialInfo(ClassDoc cd, Content contentTree) {
addPreQualifiedStrongClassLink(LinkInfoImpl.CONTEXT_TREE, cd, contentTree); addPreQualifiedStrongClassLink(LinkInfoImpl.Kind.TREE, cd, contentTree);
} }
/** /**

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -160,7 +160,7 @@ public class AllClassesFrameWriter extends HtmlDocletWriter {
Content linkContent; Content linkContent;
if(wantFrames){ if(wantFrames){
linkContent = new RawHtml(getLink(new LinkInfoImpl(configuration, linkContent = new RawHtml(getLink(new LinkInfoImpl(configuration,
LinkInfoImpl.ALL_CLASSES_FRAME, cd, label, "classFrame"))); LinkInfoImpl.Kind.ALL_CLASSES_FRAME, cd, label, "classFrame")));
} else { } else {
linkContent = new RawHtml(getLink(new LinkInfoImpl( linkContent = new RawHtml(getLink(new LinkInfoImpl(
configuration, cd, label))); configuration, cd, label)));

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -107,7 +107,7 @@ public class AnnotationTypeRequiredMemberWriterImpl extends AbstractMemberWriter
addModifiers(member, pre); addModifiers(member, pre);
Content link = new RawHtml( Content link = new RawHtml(
writer.getLink(new LinkInfoImpl(configuration, writer.getLink(new LinkInfoImpl(configuration,
LinkInfoImpl.CONTEXT_MEMBER, getType(member)))); LinkInfoImpl.Kind.MEMBER, getType(member))));
pre.addContent(link); pre.addContent(link);
pre.addContent(writer.getSpace()); pre.addContent(writer.getSpace());
if (configuration.linksource) { if (configuration.linksource) {
@ -223,7 +223,7 @@ public class AnnotationTypeRequiredMemberWriterImpl extends AbstractMemberWriter
/** /**
* {@inheritDoc} * {@inheritDoc}
*/ */
protected void addSummaryLink(int context, ClassDoc cd, ProgramElementDoc member, protected void addSummaryLink(LinkInfoImpl.Kind context, ClassDoc cd, ProgramElementDoc member,
Content tdSummary) { Content tdSummary) {
Content strong = HtmlTree.STRONG(new RawHtml( Content strong = HtmlTree.STRONG(new RawHtml(
writer.getDocLink(context, (MemberDoc) member, member.name(), false))); writer.getDocLink(context, (MemberDoc) member, member.name(), false)));
@ -251,7 +251,7 @@ public class AnnotationTypeRequiredMemberWriterImpl extends AbstractMemberWriter
* {@inheritDoc} * {@inheritDoc}
*/ */
protected Content getDeprecatedLink(ProgramElementDoc member) { protected Content getDeprecatedLink(ProgramElementDoc member) {
return writer.getDocLink(LinkInfoImpl.CONTEXT_MEMBER, return writer.getDocLink(LinkInfoImpl.Kind.MEMBER,
(MemberDoc) member, ((MemberDoc)member).qualifiedName()); (MemberDoc) member, ((MemberDoc)member).qualifiedName());
} }

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -117,7 +117,7 @@ public class AnnotationTypeWriterImpl extends SubWriterHolderWriter
Content li; Content li;
if (prev != null) { if (prev != null) {
Content prevLink = new RawHtml(getLink(new LinkInfoImpl(configuration, Content prevLink = new RawHtml(getLink(new LinkInfoImpl(configuration,
LinkInfoImpl.CONTEXT_CLASS, prev.asClassDoc(), "", LinkInfoImpl.Kind.CLASS, prev.asClassDoc(), "",
configuration.getText("doclet.Prev_Class"), true))); configuration.getText("doclet.Prev_Class"), true)));
li = HtmlTree.LI(prevLink); li = HtmlTree.LI(prevLink);
} }
@ -135,7 +135,7 @@ public class AnnotationTypeWriterImpl extends SubWriterHolderWriter
Content li; Content li;
if (next != null) { if (next != null) {
Content nextLink = new RawHtml(getLink(new LinkInfoImpl(configuration, Content nextLink = new RawHtml(getLink(new LinkInfoImpl(configuration,
LinkInfoImpl.CONTEXT_CLASS, next.asClassDoc(), "", LinkInfoImpl.Kind.CLASS, next.asClassDoc(), "",
configuration.getText("doclet.Next_Class"), true))); configuration.getText("doclet.Next_Class"), true)));
li = HtmlTree.LI(nextLink); li = HtmlTree.LI(nextLink);
} }
@ -163,7 +163,7 @@ public class AnnotationTypeWriterImpl extends SubWriterHolderWriter
div.addContent(pkgNameDiv); div.addContent(pkgNameDiv);
} }
LinkInfoImpl linkInfo = new LinkInfoImpl(configuration, LinkInfoImpl linkInfo = new LinkInfoImpl(configuration,
LinkInfoImpl.CONTEXT_CLASS_HEADER, annotationType, false); LinkInfoImpl.Kind.CLASS_HEADER, annotationType, false);
Content headerContent = new StringContent(header); Content headerContent = new StringContent(header);
Content heading = HtmlTree.HEADING(HtmlConstants.CLASS_PAGE_HEADING, true, Content heading = HtmlTree.HEADING(HtmlConstants.CLASS_PAGE_HEADING, true,
HtmlStyle.title, headerContent); HtmlStyle.title, headerContent);
@ -220,7 +220,7 @@ public class AnnotationTypeWriterImpl extends SubWriterHolderWriter
addAnnotationInfo(annotationType, pre); addAnnotationInfo(annotationType, pre);
pre.addContent(modifiers); pre.addContent(modifiers);
LinkInfoImpl linkInfo = new LinkInfoImpl(configuration, LinkInfoImpl linkInfo = new LinkInfoImpl(configuration,
LinkInfoImpl.CONTEXT_CLASS_SIGNATURE, annotationType, false); LinkInfoImpl.Kind.CLASS_SIGNATURE, annotationType, false);
Content annotationName = new StringContent(annotationType.name()); Content annotationName = new StringContent(annotationType.name());
Content parameterLinks = new RawHtml(getTypeParameterLinks(linkInfo)); Content parameterLinks = new RawHtml(getTypeParameterLinks(linkInfo));
if (configuration.linksource) { if (configuration.linksource) {

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -258,7 +258,7 @@ public class ClassUseWriter extends SubWriterHolderWriter {
Content table = HtmlTree.TABLE(0, 3, 0, useTableSummary, Content table = HtmlTree.TABLE(0, 3, 0, useTableSummary,
getTableCaption(configuration.getText( getTableCaption(configuration.getText(
"doclet.ClassUse_Packages.that.use.0", "doclet.ClassUse_Packages.that.use.0",
getLink(new LinkInfoImpl(configuration, LinkInfoImpl.CONTEXT_CLASS_USE_HEADER, classdoc, getLink(new LinkInfoImpl(configuration, LinkInfoImpl.Kind.CLASS_USE_HEADER, classdoc,
false))))); false)))));
table.addContent(getSummaryTableHeader(packageTableHeader, "col")); table.addContent(getSummaryTableHeader(packageTableHeader, "col"));
Content tbody = new HtmlTree(HtmlTag.TBODY); Content tbody = new HtmlTree(HtmlTag.TBODY);
@ -294,7 +294,7 @@ public class ClassUseWriter extends SubWriterHolderWriter {
getTableCaption(configuration.getText( getTableCaption(configuration.getText(
"doclet.ClassUse_PackageAnnotation", "doclet.ClassUse_PackageAnnotation",
getLink(new LinkInfoImpl(configuration, getLink(new LinkInfoImpl(configuration,
LinkInfoImpl.CONTEXT_CLASS_USE_HEADER, classdoc, false))))); LinkInfoImpl.Kind.CLASS_USE_HEADER, classdoc, false)))));
table.addContent(getSummaryTableHeader(packageTableHeader, "col")); table.addContent(getSummaryTableHeader(packageTableHeader, "col"));
Content tbody = new HtmlTree(HtmlTag.TBODY); Content tbody = new HtmlTree(HtmlTag.TBODY);
Iterator<PackageDoc> it = pkgToPackageAnnotations.iterator(); Iterator<PackageDoc> it = pkgToPackageAnnotations.iterator();
@ -333,7 +333,7 @@ public class ClassUseWriter extends SubWriterHolderWriter {
Content li = HtmlTree.LI(HtmlStyle.blockList, getMarkerAnchor(pkg.name())); Content li = HtmlTree.LI(HtmlStyle.blockList, getMarkerAnchor(pkg.name()));
Content link = new RawHtml( Content link = new RawHtml(
configuration.getText("doclet.ClassUse_Uses.of.0.in.1", configuration.getText("doclet.ClassUse_Uses.of.0.in.1",
getLink(new LinkInfoImpl(configuration, LinkInfoImpl.CONTEXT_CLASS_USE_HEADER, getLink(new LinkInfoImpl(configuration, LinkInfoImpl.Kind.CLASS_USE_HEADER,
classdoc, false)), classdoc, false)),
getPackageLinkString(pkg, Util.getPackageName(pkg), false))); getPackageLinkString(pkg, Util.getPackageName(pkg), false)));
Content heading = HtmlTree.HEADING(HtmlConstants.SUMMARY_HEADING, link); Content heading = HtmlTree.HEADING(HtmlConstants.SUMMARY_HEADING, link);
@ -369,7 +369,7 @@ public class ClassUseWriter extends SubWriterHolderWriter {
*/ */
protected void addClassUse(PackageDoc pkg, Content contentTree) throws IOException { protected void addClassUse(PackageDoc pkg, Content contentTree) throws IOException {
String classLink = getLink(new LinkInfoImpl(configuration, String classLink = getLink(new LinkInfoImpl(configuration,
LinkInfoImpl.CONTEXT_CLASS_USE_HEADER, classdoc, false)); LinkInfoImpl.Kind.CLASS_USE_HEADER, classdoc, false));
String pkgLink = getPackageLinkString(pkg, Util.getPackageName(pkg), false); String pkgLink = getPackageLinkString(pkg, Util.getPackageName(pkg), false);
classSubWriter.addUseInfo(pkgToClassAnnotations.get(pkg.name()), classSubWriter.addUseInfo(pkgToClassAnnotations.get(pkg.name()),
configuration.getText("doclet.ClassUse_Annotation", classLink, configuration.getText("doclet.ClassUse_Annotation", classLink,
@ -477,7 +477,7 @@ public class ClassUseWriter extends SubWriterHolderWriter {
*/ */
protected Content getNavLinkClass() { protected Content getNavLinkClass() {
Content linkContent = new RawHtml(getLink(new LinkInfoImpl( Content linkContent = new RawHtml(getLink(new LinkInfoImpl(
configuration, LinkInfoImpl.CONTEXT_CLASS_USE_HEADER, classdoc, configuration, LinkInfoImpl.Kind.CLASS_USE_HEADER, classdoc,
"", configuration.getText("doclet.Class"), false))); "", configuration.getText("doclet.Class"), false)));
Content li = HtmlTree.LI(linkContent); Content li = HtmlTree.LI(linkContent);
return li; return li;

View File

@ -125,7 +125,7 @@ public class ClassWriterImpl extends SubWriterHolderWriter
Content li; Content li;
if (prev != null) { if (prev != null) {
Content prevLink = new RawHtml(getLink(new LinkInfoImpl(configuration, Content prevLink = new RawHtml(getLink(new LinkInfoImpl(configuration,
LinkInfoImpl.CONTEXT_CLASS, prev, "", LinkInfoImpl.Kind.CLASS, prev, "",
configuration.getText("doclet.Prev_Class"), true))); configuration.getText("doclet.Prev_Class"), true)));
li = HtmlTree.LI(prevLink); li = HtmlTree.LI(prevLink);
} }
@ -143,7 +143,7 @@ public class ClassWriterImpl extends SubWriterHolderWriter
Content li; Content li;
if (next != null) { if (next != null) {
Content nextLink = new RawHtml(getLink(new LinkInfoImpl(configuration, Content nextLink = new RawHtml(getLink(new LinkInfoImpl(configuration,
LinkInfoImpl.CONTEXT_CLASS, next, "", LinkInfoImpl.Kind.CLASS, next, "",
configuration.getText("doclet.Next_Class"), true))); configuration.getText("doclet.Next_Class"), true)));
li = HtmlTree.LI(nextLink); li = HtmlTree.LI(nextLink);
} }
@ -185,7 +185,7 @@ public class ClassWriterImpl extends SubWriterHolderWriter
div.addContent(pkgNameDiv); div.addContent(pkgNameDiv);
} }
LinkInfoImpl linkInfo = new LinkInfoImpl(configuration, LinkInfoImpl linkInfo = new LinkInfoImpl(configuration,
LinkInfoImpl.CONTEXT_CLASS_HEADER, classDoc, false); LinkInfoImpl.Kind.CLASS_HEADER, classDoc, false);
//Let's not link to ourselves in the header. //Let's not link to ourselves in the header.
linkInfo.linkToSelf = false; linkInfo.linkToSelf = false;
Content headerContent = new StringContent(header); Content headerContent = new StringContent(header);
@ -245,7 +245,7 @@ public class ClassWriterImpl extends SubWriterHolderWriter
addAnnotationInfo(classDoc, pre); addAnnotationInfo(classDoc, pre);
pre.addContent(modifiers); pre.addContent(modifiers);
LinkInfoImpl linkInfo = new LinkInfoImpl(configuration, LinkInfoImpl linkInfo = new LinkInfoImpl(configuration,
LinkInfoImpl.CONTEXT_CLASS_SIGNATURE, classDoc, false); LinkInfoImpl.Kind.CLASS_SIGNATURE, classDoc, false);
//Let's not link to ourselves in the signature. //Let's not link to ourselves in the signature.
linkInfo.linkToSelf = false; linkInfo.linkToSelf = false;
Content className = new StringContent(classDoc.name()); Content className = new StringContent(classDoc.name());
@ -265,7 +265,7 @@ public class ClassWriterImpl extends SubWriterHolderWriter
pre.addContent(DocletConstants.NL); pre.addContent(DocletConstants.NL);
pre.addContent("extends "); pre.addContent("extends ");
Content link = new RawHtml(getLink(new LinkInfoImpl(configuration, Content link = new RawHtml(getLink(new LinkInfoImpl(configuration,
LinkInfoImpl.CONTEXT_CLASS_SIGNATURE_PARENT_NAME, LinkInfoImpl.Kind.CLASS_SIGNATURE_PARENT_NAME,
superclass))); superclass)));
pre.addContent(link); pre.addContent(link);
} }
@ -286,7 +286,7 @@ public class ClassWriterImpl extends SubWriterHolderWriter
pre.addContent(", "); pre.addContent(", ");
} }
Content link = new RawHtml(getLink(new LinkInfoImpl(configuration, Content link = new RawHtml(getLink(new LinkInfoImpl(configuration,
LinkInfoImpl.CONTEXT_CLASS_SIGNATURE_PARENT_NAME, LinkInfoImpl.Kind.CLASS_SIGNATURE_PARENT_NAME,
implIntfacs[i]))); implIntfacs[i])));
pre.addContent(link); pre.addContent(link);
counter++; counter++;
@ -361,7 +361,7 @@ public class ClassWriterImpl extends SubWriterHolderWriter
Content li = new HtmlTree(HtmlTag.LI); Content li = new HtmlTree(HtmlTag.LI);
if (type.equals(classDoc)) { if (type.equals(classDoc)) {
String typeParameters = getTypeParameterLinks( String typeParameters = getTypeParameterLinks(
new LinkInfoImpl(configuration, LinkInfoImpl.CONTEXT_TREE, new LinkInfoImpl(configuration, LinkInfoImpl.Kind.TREE,
classDoc, false)); classDoc, false));
if (configuration.shouldExcludeQualifier( if (configuration.shouldExcludeQualifier(
classDoc.containingPackage().name())) { classDoc.containingPackage().name())) {
@ -373,7 +373,7 @@ public class ClassWriterImpl extends SubWriterHolderWriter
} }
} else { } else {
Content link = new RawHtml(getLink(new LinkInfoImpl(configuration, Content link = new RawHtml(getLink(new LinkInfoImpl(configuration,
LinkInfoImpl.CONTEXT_CLASS_TREE_PARENT, LinkInfoImpl.Kind.CLASS_TREE_PARENT,
type instanceof ClassDoc ? (ClassDoc) type : type, type instanceof ClassDoc ? (ClassDoc) type : type,
configuration.getClassName(type.asClassDoc()), false))); configuration.getClassName(type.asClassDoc()), false)));
li.addContent(link); li.addContent(link);
@ -419,7 +419,7 @@ public class ClassWriterImpl extends SubWriterHolderWriter
"doclet.Subclasses"); "doclet.Subclasses");
Content dt = HtmlTree.DT(label); Content dt = HtmlTree.DT(label);
Content dl = HtmlTree.DL(dt); Content dl = HtmlTree.DL(dt);
dl.addContent(getClassLinks(LinkInfoImpl.CONTEXT_SUBCLASSES, dl.addContent(getClassLinks(LinkInfoImpl.Kind.SUBCLASSES,
subclasses)); subclasses));
classInfoTree.addContent(dl); classInfoTree.addContent(dl);
} }
@ -437,7 +437,7 @@ public class ClassWriterImpl extends SubWriterHolderWriter
"doclet.Subinterfaces"); "doclet.Subinterfaces");
Content dt = HtmlTree.DT(label); Content dt = HtmlTree.DT(label);
Content dl = HtmlTree.DL(dt); Content dl = HtmlTree.DL(dt);
dl.addContent(getClassLinks(LinkInfoImpl.CONTEXT_SUBINTERFACES, dl.addContent(getClassLinks(LinkInfoImpl.Kind.SUBINTERFACES,
subInterfaces)); subInterfaces));
classInfoTree.addContent(dl); classInfoTree.addContent(dl);
} }
@ -461,7 +461,7 @@ public class ClassWriterImpl extends SubWriterHolderWriter
"doclet.Implementing_Classes"); "doclet.Implementing_Classes");
Content dt = HtmlTree.DT(label); Content dt = HtmlTree.DT(label);
Content dl = HtmlTree.DL(dt); Content dl = HtmlTree.DL(dt);
dl.addContent(getClassLinks(LinkInfoImpl.CONTEXT_IMPLEMENTED_CLASSES, dl.addContent(getClassLinks(LinkInfoImpl.Kind.IMPLEMENTED_CLASSES,
implcl)); implcl));
classInfoTree.addContent(dl); classInfoTree.addContent(dl);
} }
@ -479,7 +479,7 @@ public class ClassWriterImpl extends SubWriterHolderWriter
"doclet.All_Implemented_Interfaces"); "doclet.All_Implemented_Interfaces");
Content dt = HtmlTree.DT(label); Content dt = HtmlTree.DT(label);
Content dl = HtmlTree.DL(dt); Content dl = HtmlTree.DL(dt);
dl.addContent(getClassLinks(LinkInfoImpl.CONTEXT_IMPLEMENTED_INTERFACES, dl.addContent(getClassLinks(LinkInfoImpl.Kind.IMPLEMENTED_INTERFACES,
interfaceArray)); interfaceArray));
classInfoTree.addContent(dl); classInfoTree.addContent(dl);
} }
@ -497,7 +497,7 @@ public class ClassWriterImpl extends SubWriterHolderWriter
"doclet.All_Superinterfaces"); "doclet.All_Superinterfaces");
Content dt = HtmlTree.DT(label); Content dt = HtmlTree.DT(label);
Content dl = HtmlTree.DL(dt); Content dl = HtmlTree.DL(dt);
dl.addContent(getClassLinks(LinkInfoImpl.CONTEXT_SUPER_INTERFACES, dl.addContent(getClassLinks(LinkInfoImpl.Kind.SUPER_INTERFACES,
interfaceArray)); interfaceArray));
classInfoTree.addContent(dl); classInfoTree.addContent(dl);
} }
@ -521,7 +521,7 @@ public class ClassWriterImpl extends SubWriterHolderWriter
Content dl = HtmlTree.DL(dt); Content dl = HtmlTree.DL(dt);
Content dd = new HtmlTree(HtmlTag.DD); Content dd = new HtmlTree(HtmlTag.DD);
dd.addContent(new RawHtml(getLink(new LinkInfoImpl(configuration, dd.addContent(new RawHtml(getLink(new LinkInfoImpl(configuration,
LinkInfoImpl.CONTEXT_CLASS, outerClass, false)))); LinkInfoImpl.Kind.CLASS, outerClass, false))));
dl.addContent(dd); dl.addContent(dd);
classInfoTree.addContent(dl); classInfoTree.addContent(dl);
} }
@ -569,7 +569,7 @@ public class ClassWriterImpl extends SubWriterHolderWriter
* @param list the list of classes * @param list the list of classes
* @return a content tree for the class list * @return a content tree for the class list
*/ */
private Content getClassLinks(int context, List<?> list) { private Content getClassLinks(LinkInfoImpl.Kind context, List<?> list) {
Object[] typeList = list.toArray(); Object[] typeList = list.toArray();
Content dd = new HtmlTree(HtmlTag.DD); Content dd = new HtmlTree(HtmlTag.DD);
for (int i = 0; i < list.size(); i++) { for (int i = 0; i < list.size(); i++) {

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -186,7 +186,7 @@ public class ConstantsSummaryWriterImpl extends HtmlDocletWriter
//generate links backward only to public classes. //generate links backward only to public classes.
String classlink = (cd.isPublic() || cd.isProtected()) ? String classlink = (cd.isPublic() || cd.isProtected()) ?
getLink(new LinkInfoImpl(configuration, getLink(new LinkInfoImpl(configuration,
LinkInfoImpl.CONTEXT_CONSTANT_SUMMARY, cd, false)) : LinkInfoImpl.Kind.CONSTANT_SUMMARY, cd, false)) :
cd.qualifiedName(); cd.qualifiedName();
String name = cd.containingPackage().name(); String name = cd.containingPackage().name();
if (name.length() > 0) { if (name.length() > 0) {
@ -261,7 +261,7 @@ public class ConstantsSummaryWriterImpl extends HtmlDocletWriter
code.addContent(getSpace()); code.addContent(getSpace());
} }
Content type = new RawHtml(getLink(new LinkInfoImpl(configuration, Content type = new RawHtml(getLink(new LinkInfoImpl(configuration,
LinkInfoImpl.CONTEXT_CONSTANT_SUMMARY, member.type()))); LinkInfoImpl.Kind.CONSTANT_SUMMARY, member.type())));
code.addContent(type); code.addContent(type);
tdType.addContent(code); tdType.addContent(code);
return tdType; return tdType;
@ -275,7 +275,7 @@ public class ConstantsSummaryWriterImpl extends HtmlDocletWriter
*/ */
private Content getNameColumn(FieldDoc member) { private Content getNameColumn(FieldDoc member) {
Content nameContent = new RawHtml(getDocLink( Content nameContent = new RawHtml(getDocLink(
LinkInfoImpl.CONTEXT_CONSTANT_SUMMARY, member, member.name(), false)); LinkInfoImpl.Kind.CONSTANT_SUMMARY, member, member.name(), false));
Content code = HtmlTree.CODE(nameContent); Content code = HtmlTree.CODE(nameContent);
return HtmlTree.TD(code); return HtmlTree.TD(code);
} }

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -102,7 +102,7 @@ public class EnumConstantWriterImpl extends AbstractMemberWriter
writer.addAnnotationInfo(enumConstant, pre); writer.addAnnotationInfo(enumConstant, pre);
addModifiers(enumConstant, pre); addModifiers(enumConstant, pre);
Content enumConstantLink = new RawHtml(writer.getLink(new LinkInfoImpl( Content enumConstantLink = new RawHtml(writer.getLink(new LinkInfoImpl(
configuration, LinkInfoImpl.CONTEXT_MEMBER, enumConstant.type()))); configuration, LinkInfoImpl.Kind.MEMBER, enumConstant.type())));
pre.addContent(enumConstantLink); pre.addContent(enumConstantLink);
pre.addContent(" "); pre.addContent(" ");
if (configuration.linksource) { if (configuration.linksource) {
@ -220,7 +220,7 @@ public class EnumConstantWriterImpl extends AbstractMemberWriter
/** /**
* {@inheritDoc} * {@inheritDoc}
*/ */
protected void addSummaryLink(int context, ClassDoc cd, ProgramElementDoc member, protected void addSummaryLink(LinkInfoImpl.Kind context, ClassDoc cd, ProgramElementDoc member,
Content tdSummary) { Content tdSummary) {
Content strong = HtmlTree.STRONG(new RawHtml( Content strong = HtmlTree.STRONG(new RawHtml(
writer.getDocLink(context, (MemberDoc) member, member.name(), false))); writer.getDocLink(context, (MemberDoc) member, member.name(), false)));
@ -254,7 +254,7 @@ public class EnumConstantWriterImpl extends AbstractMemberWriter
* {@inheritDoc} * {@inheritDoc}
*/ */
protected Content getDeprecatedLink(ProgramElementDoc member) { protected Content getDeprecatedLink(ProgramElementDoc member) {
return writer.getDocLink(LinkInfoImpl.CONTEXT_MEMBER, return writer.getDocLink(LinkInfoImpl.Kind.MEMBER,
(MemberDoc) member, ((FieldDoc)member).qualifiedName()); (MemberDoc) member, ((FieldDoc)member).qualifiedName());
} }

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -103,7 +103,7 @@ public class FieldWriterImpl extends AbstractMemberWriter
writer.addAnnotationInfo(field, pre); writer.addAnnotationInfo(field, pre);
addModifiers(field, pre); addModifiers(field, pre);
Content fieldlink = new RawHtml(writer.getLink(new LinkInfoImpl( Content fieldlink = new RawHtml(writer.getLink(new LinkInfoImpl(
configuration, LinkInfoImpl.CONTEXT_MEMBER, field.type()))); configuration, LinkInfoImpl.Kind.MEMBER, field.type())));
pre.addContent(fieldlink); pre.addContent(fieldlink);
pre.addContent(" "); pre.addContent(" ");
if (configuration.linksource) { if (configuration.linksource) {
@ -133,7 +133,7 @@ public class FieldWriterImpl extends AbstractMemberWriter
writer.addInlineComment(field, fieldDocTree); writer.addInlineComment(field, fieldDocTree);
} else { } else {
Content link = new RawHtml( Content link = new RawHtml(
writer.getDocLink(LinkInfoImpl.CONTEXT_FIELD_DOC_COPY, writer.getDocLink(LinkInfoImpl.Kind.FIELD_DOC_COPY,
holder, field, holder, field,
holder.isIncluded() ? holder.isIncluded() ?
holder.typeName() : holder.qualifiedTypeName(), holder.typeName() : holder.qualifiedTypeName(),
@ -240,7 +240,7 @@ public class FieldWriterImpl extends AbstractMemberWriter
*/ */
public void addInheritedSummaryLabel(ClassDoc cd, Content inheritedTree) { public void addInheritedSummaryLabel(ClassDoc cd, Content inheritedTree) {
Content classLink = new RawHtml(writer.getPreQualifiedClassLink( Content classLink = new RawHtml(writer.getPreQualifiedClassLink(
LinkInfoImpl.CONTEXT_MEMBER, cd, false)); LinkInfoImpl.Kind.MEMBER, cd, false));
Content label = new StringContent(cd.isClass() ? Content label = new StringContent(cd.isClass() ?
configuration.getText("doclet.Fields_Inherited_From_Class") : configuration.getText("doclet.Fields_Inherited_From_Class") :
configuration.getText("doclet.Fields_Inherited_From_Interface")); configuration.getText("doclet.Fields_Inherited_From_Interface"));
@ -254,7 +254,7 @@ public class FieldWriterImpl extends AbstractMemberWriter
/** /**
* {@inheritDoc} * {@inheritDoc}
*/ */
protected void addSummaryLink(int context, ClassDoc cd, ProgramElementDoc member, protected void addSummaryLink(LinkInfoImpl.Kind context, ClassDoc cd, ProgramElementDoc member,
Content tdSummary) { Content tdSummary) {
Content strong = HtmlTree.STRONG(new RawHtml( Content strong = HtmlTree.STRONG(new RawHtml(
writer.getDocLink(context, cd , (MemberDoc) member, member.name(), false))); writer.getDocLink(context, cd , (MemberDoc) member, member.name(), false)));
@ -268,7 +268,7 @@ public class FieldWriterImpl extends AbstractMemberWriter
protected void addInheritedSummaryLink(ClassDoc cd, protected void addInheritedSummaryLink(ClassDoc cd,
ProgramElementDoc member, Content linksTree) { ProgramElementDoc member, Content linksTree) {
linksTree.addContent(new RawHtml( linksTree.addContent(new RawHtml(
writer.getDocLink(LinkInfoImpl.CONTEXT_MEMBER, cd, (MemberDoc)member, writer.getDocLink(LinkInfoImpl.Kind.MEMBER, cd, (MemberDoc)member,
member.name(), false))); member.name(), false)));
} }
@ -284,7 +284,7 @@ public class FieldWriterImpl extends AbstractMemberWriter
* {@inheritDoc} * {@inheritDoc}
*/ */
protected Content getDeprecatedLink(ProgramElementDoc member) { protected Content getDeprecatedLink(ProgramElementDoc member) {
return writer.getDocLink(LinkInfoImpl.CONTEXT_MEMBER, return writer.getDocLink(LinkInfoImpl.Kind.MEMBER,
(MemberDoc) member, ((FieldDoc)member).qualifiedName()); (MemberDoc) member, ((FieldDoc)member).qualifiedName());
} }

View File

@ -373,7 +373,7 @@ public class HtmlDocletWriter extends HtmlDocWriter {
continue; continue;
} }
Content classContent = new RawHtml(getLink(new LinkInfoImpl( Content classContent = new RawHtml(getLink(new LinkInfoImpl(
configuration, LinkInfoImpl.CONTEXT_PACKAGE, classes[i], configuration, LinkInfoImpl.Kind.PACKAGE, classes[i],
false))); false)));
Content tdClass = HtmlTree.TD(HtmlStyle.colFirst, classContent); Content tdClass = HtmlTree.TD(HtmlStyle.colFirst, classContent);
HtmlTree tr = HtmlTree.TR(tdClass); HtmlTree tr = HtmlTree.TR(tdClass);
@ -1191,7 +1191,7 @@ public class HtmlDocletWriter extends HtmlDocWriter {
* @param cd the class doc to link to * @param cd the class doc to link to
* @return a content tree for the link * @return a content tree for the link
*/ */
public Content getQualifiedClassLink(int context, ClassDoc cd) { public Content getQualifiedClassLink(LinkInfoImpl.Kind context, ClassDoc cd) {
return new RawHtml(getLink(new LinkInfoImpl(configuration, context, cd, return new RawHtml(getLink(new LinkInfoImpl(configuration, context, cd,
configuration.getClassName(cd), ""))); configuration.getClassName(cd), "")));
} }
@ -1203,7 +1203,7 @@ public class HtmlDocletWriter extends HtmlDocWriter {
* @param cd the class doc to link to * @param cd the class doc to link to
* @param contentTree the content tree to which the link will be added * @param contentTree the content tree to which the link will be added
*/ */
public void addPreQualifiedClassLink(int context, ClassDoc cd, Content contentTree) { public void addPreQualifiedClassLink(LinkInfoImpl.Kind context, ClassDoc cd, Content contentTree) {
addPreQualifiedClassLink(context, cd, false, contentTree); addPreQualifiedClassLink(context, cd, false, contentTree);
} }
@ -1216,7 +1216,7 @@ public class HtmlDocletWriter extends HtmlDocWriter {
* @param isStrong true if the link should be strong. * @param isStrong true if the link should be strong.
* @return the link with the package portion of the label in plain text. * @return the link with the package portion of the label in plain text.
*/ */
public String getPreQualifiedClassLink(int context, public String getPreQualifiedClassLink(LinkInfoImpl.Kind context,
ClassDoc cd, boolean isStrong) { ClassDoc cd, boolean isStrong) {
String classlink = ""; String classlink = "";
PackageDoc pd = cd.containingPackage(); PackageDoc pd = cd.containingPackage();
@ -1238,7 +1238,7 @@ public class HtmlDocletWriter extends HtmlDocWriter {
* @param isStrong true if the link should be strong * @param isStrong true if the link should be strong
* @param contentTree the content tree to which the link with be added * @param contentTree the content tree to which the link with be added
*/ */
public void addPreQualifiedClassLink(int context, public void addPreQualifiedClassLink(LinkInfoImpl.Kind context,
ClassDoc cd, boolean isStrong, Content contentTree) { ClassDoc cd, boolean isStrong, Content contentTree) {
PackageDoc pd = cd.containingPackage(); PackageDoc pd = cd.containingPackage();
if(pd != null && ! configuration.shouldExcludeQualifier(pd.name())) { if(pd != null && ! configuration.shouldExcludeQualifier(pd.name())) {
@ -1256,7 +1256,7 @@ public class HtmlDocletWriter extends HtmlDocWriter {
* @param cd the class to link to * @param cd the class to link to
* @param contentTree the content tree to which the link with be added * @param contentTree the content tree to which the link with be added
*/ */
public void addPreQualifiedStrongClassLink(int context, ClassDoc cd, Content contentTree) { public void addPreQualifiedStrongClassLink(LinkInfoImpl.Kind context, ClassDoc cd, Content contentTree) {
addPreQualifiedClassLink(context, cd, true, contentTree); addPreQualifiedClassLink(context, cd, true, contentTree);
} }
@ -1268,7 +1268,7 @@ public class HtmlDocletWriter extends HtmlDocWriter {
* @param label the label for the link * @param label the label for the link
* @return a content tree for the doc link * @return a content tree for the doc link
*/ */
public Content getDocLink(int context, MemberDoc doc, String label) { public Content getDocLink(LinkInfoImpl.Kind context, MemberDoc doc, String label) {
return getDocLink(context, doc.containingClass(), doc, label); return getDocLink(context, doc.containingClass(), doc, label);
} }
@ -1281,7 +1281,7 @@ public class HtmlDocletWriter extends HtmlDocWriter {
* @param strong true if the link should be strong. * @param strong true if the link should be strong.
* @return the link for the given member. * @return the link for the given member.
*/ */
public String getDocLink(int context, MemberDoc doc, String label, public String getDocLink(LinkInfoImpl.Kind context, MemberDoc doc, String label,
boolean strong) { boolean strong) {
return getDocLink(context, doc.containingClass(), doc, label, strong); return getDocLink(context, doc.containingClass(), doc, label, strong);
} }
@ -1298,7 +1298,7 @@ public class HtmlDocletWriter extends HtmlDocWriter {
* @param strong true if the link should be strong. * @param strong true if the link should be strong.
* @return the link for the given member. * @return the link for the given member.
*/ */
public String getDocLink(int context, ClassDoc classDoc, MemberDoc doc, public String getDocLink(LinkInfoImpl.Kind context, ClassDoc classDoc, MemberDoc doc,
String label, boolean strong) { String label, boolean strong) {
return getDocLink(context, classDoc, doc, label, strong, false); return getDocLink(context, classDoc, doc, label, strong, false);
} }
@ -1316,7 +1316,7 @@ public class HtmlDocletWriter extends HtmlDocWriter {
* @param isProperty true if the doc parameter is a JavaFX property. * @param isProperty true if the doc parameter is a JavaFX property.
* @return the link for the given member. * @return the link for the given member.
*/ */
public String getDocLink(int context, ClassDoc classDoc, MemberDoc doc, public String getDocLink(LinkInfoImpl.Kind context, ClassDoc classDoc, MemberDoc doc,
String label, boolean strong, boolean isProperty) { String label, boolean strong, boolean isProperty) {
if (! (doc.isIncluded() || if (! (doc.isIncluded() ||
Util.isLinkable(classDoc, configuration))) { Util.isLinkable(classDoc, configuration))) {
@ -1344,7 +1344,7 @@ public class HtmlDocletWriter extends HtmlDocWriter {
* @param label the label for the link * @param label the label for the link
* @return the link for the given member * @return the link for the given member
*/ */
public Content getDocLink(int context, ClassDoc classDoc, MemberDoc doc, public Content getDocLink(LinkInfoImpl.Kind context, ClassDoc classDoc, MemberDoc doc,
String label) { String label) {
if (! (doc.isIncluded() || if (! (doc.isIncluded() ||
Util.isLinkable(classDoc, configuration))) { Util.isLinkable(classDoc, configuration))) {
@ -1480,7 +1480,7 @@ public class HtmlDocletWriter extends HtmlDocWriter {
text = plainOrCodeText(plain, Util.escapeHtmlChars(refMemName)); text = plainOrCodeText(plain, Util.escapeHtmlChars(refMemName));
return getDocLink(LinkInfoImpl.CONTEXT_SEE_TAG, containing, return getDocLink(LinkInfoImpl.Kind.SEE_TAG, containing,
refMem, (label.isEmpty() ? text: label), false); refMem, (label.isEmpty() ? text: label), false);
} }
} }
@ -1998,7 +1998,7 @@ public class HtmlDocletWriter extends HtmlDocWriter {
annotation = new StringBuilder(); annotation = new StringBuilder();
isAnnotationDocumented = false; isAnnotationDocumented = false;
LinkInfoImpl linkInfo = new LinkInfoImpl(configuration, LinkInfoImpl linkInfo = new LinkInfoImpl(configuration,
LinkInfoImpl.CONTEXT_ANNOTATION, annotationDoc); LinkInfoImpl.Kind.ANNOTATION, annotationDoc);
AnnotationDesc.ElementValuePair[] pairs = descList[i].elementValues(); AnnotationDesc.ElementValuePair[] pairs = descList[i].elementValues();
// If the annotation is synthesized, do not print the container. // If the annotation is synthesized, do not print the container.
if (descList[i].isSynthesized()) { if (descList[i].isSynthesized()) {
@ -2081,7 +2081,7 @@ public class HtmlDocletWriter extends HtmlDocWriter {
} }
} }
} }
annotation.append(getDocLink(LinkInfoImpl.CONTEXT_ANNOTATION, annotation.append(getDocLink(LinkInfoImpl.Kind.ANNOTATION,
pairs[j].element(), pairs[j].element().name(), false)); pairs[j].element(), pairs[j].element().name(), false));
annotation.append('='); annotation.append('=');
AnnotationValue annotationValue = pairs[j].value(); AnnotationValue annotationValue = pairs[j].value();
@ -2143,7 +2143,7 @@ public class HtmlDocletWriter extends HtmlDocWriter {
Type type = (Type) annotationValue.value(); Type type = (Type) annotationValue.value();
if (type.asClassDoc() != null) { if (type.asClassDoc() != null) {
LinkInfoImpl linkInfo = new LinkInfoImpl(configuration, LinkInfoImpl linkInfo = new LinkInfoImpl(configuration,
LinkInfoImpl.CONTEXT_ANNOTATION, type); LinkInfoImpl.Kind.ANNOTATION, type);
linkInfo.label = (type.asClassDoc().isIncluded() ? linkInfo.label = (type.asClassDoc().isIncluded() ?
type.typeName() : type.typeName() :
type.qualifiedTypeName()) + type.dimension() + ".class"; type.qualifiedTypeName()) + type.dimension() + ".class";
@ -2161,7 +2161,7 @@ public class HtmlDocletWriter extends HtmlDocWriter {
} }
return buf.toString(); return buf.toString();
} else if (annotationValue.value() instanceof MemberDoc) { } else if (annotationValue.value() instanceof MemberDoc) {
return getDocLink(LinkInfoImpl.CONTEXT_ANNOTATION, return getDocLink(LinkInfoImpl.Kind.ANNOTATION,
(MemberDoc) annotationValue.value(), (MemberDoc) annotationValue.value(),
((MemberDoc) annotationValue.value()).name(), false); ((MemberDoc) annotationValue.value()).name(), false);
} else { } else {

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -130,7 +130,7 @@ public class HtmlSerialFieldWriter extends FieldWriterImpl
pre.addContent(fieldTypeStr); pre.addContent(fieldTypeStr);
} else { } else {
Content fieldContent = new RawHtml(writer.getLink(new LinkInfoImpl( Content fieldContent = new RawHtml(writer.getLink(new LinkInfoImpl(
configuration, LinkInfoImpl.CONTEXT_SERIAL_MEMBER, fieldType))); configuration, LinkInfoImpl.Kind.SERIAL_MEMBER, fieldType)));
pre.addContent(fieldContent); pre.addContent(fieldContent);
} }
pre.addContent(fieldDimensions + " "); pre.addContent(fieldDimensions + " ");

View File

@ -121,7 +121,7 @@ public class LinkFactoryImpl extends LinkFactory {
protected LinkOutput getTypeParameterLink(LinkInfo linkInfo, protected LinkOutput getTypeParameterLink(LinkInfo linkInfo,
Type typeParam) { Type typeParam) {
LinkInfoImpl typeLinkInfo = new LinkInfoImpl(m_writer.configuration, LinkInfoImpl typeLinkInfo = new LinkInfoImpl(m_writer.configuration,
linkInfo.getContext(), typeParam); ((LinkInfoImpl) linkInfo).getContext(), typeParam);
typeLinkInfo.excludeTypeBounds = linkInfo.excludeTypeBounds; typeLinkInfo.excludeTypeBounds = linkInfo.excludeTypeBounds;
typeLinkInfo.excludeTypeParameterLinks = linkInfo.excludeTypeParameterLinks; typeLinkInfo.excludeTypeParameterLinks = linkInfo.excludeTypeParameterLinks;
typeLinkInfo.linkToSelf = linkInfo.linkToSelf; typeLinkInfo.linkToSelf = linkInfo.linkToSelf;
@ -204,7 +204,7 @@ public class LinkFactoryImpl extends LinkFactory {
* @param linkInfo the information about the link. * @param linkInfo the information about the link.
*/ */
private DocPath getPath(LinkInfoImpl linkInfo) { private DocPath getPath(LinkInfoImpl linkInfo) {
if (linkInfo.context == LinkInfoImpl.PACKAGE_FRAME) { if (linkInfo.context == LinkInfoImpl.Kind.PACKAGE_FRAME) {
//Not really necessary to do this but we want to be consistent //Not really necessary to do this but we want to be consistent
//with 1.4.2 output. //with 1.4.2 output.
return DocPath.forName(linkInfo.classDoc); return DocPath.forName(linkInfo.classDoc);

View File

@ -38,177 +38,181 @@ import com.sun.tools.doclets.internal.toolkit.util.links.*;
*/ */
public class LinkInfoImpl extends LinkInfo { public class LinkInfoImpl extends LinkInfo {
public enum Kind {
DEFAULT,
/** /**
* Indicate that the link appears in a class list. * Indicate that the link appears in a class list.
*/ */
public static final int ALL_CLASSES_FRAME = 1; ALL_CLASSES_FRAME,
/** /**
* Indicate that the link appears in a class documentation. * Indicate that the link appears in a class documentation.
*/ */
public static final int CONTEXT_CLASS = 2; CLASS,
/** /**
* Indicate that the link appears in member documentation. * Indicate that the link appears in member documentation.
*/ */
public static final int CONTEXT_MEMBER = 3; MEMBER,
/** /**
* Indicate that the link appears in class use documentation. * Indicate that the link appears in class use documentation.
*/ */
public static final int CONTEXT_CLASS_USE = 4; CLASS_USE,
/** /**
* Indicate that the link appears in index documentation. * Indicate that the link appears in index documentation.
*/ */
public static final int CONTEXT_INDEX = 5; INDEX,
/** /**
* Indicate that the link appears in constant value summary. * Indicate that the link appears in constant value summary.
*/ */
public static final int CONTEXT_CONSTANT_SUMMARY = 6; CONSTANT_SUMMARY,
/** /**
* Indicate that the link appears in serialized form documentation. * Indicate that the link appears in serialized form documentation.
*/ */
public static final int CONTEXT_SERIALIZED_FORM = 7; SERIALIZED_FORM,
/** /**
* Indicate that the link appears in serial member documentation. * Indicate that the link appears in serial member documentation.
*/ */
public static final int CONTEXT_SERIAL_MEMBER = 8; SERIAL_MEMBER,
/** /**
* Indicate that the link appears in package documentation. * Indicate that the link appears in package documentation.
*/ */
public static final int CONTEXT_PACKAGE = 9; PACKAGE,
/** /**
* Indicate that the link appears in see tag documentation. * Indicate that the link appears in see tag documentation.
*/ */
public static final int CONTEXT_SEE_TAG = 10; SEE_TAG,
/** /**
* Indicate that the link appears in value tag documentation. * Indicate that the link appears in value tag documentation.
*/ */
public static final int CONTEXT_VALUE_TAG = 11; VALUE_TAG,
/** /**
* Indicate that the link appears in tree documentation. * Indicate that the link appears in tree documentation.
*/ */
public static final int CONTEXT_TREE = 12; TREE,
/** /**
* Indicate that the link appears in a class list. * Indicate that the link appears in a class list.
*/ */
public static final int PACKAGE_FRAME = 13; PACKAGE_FRAME,
/** /**
* The header in the class documentation. * The header in the class documentation.
*/ */
public static final int CONTEXT_CLASS_HEADER = 14; CLASS_HEADER,
/** /**
* The signature in the class documentation. * The signature in the class documentation.
*/ */
public static final int CONTEXT_CLASS_SIGNATURE = 15; CLASS_SIGNATURE,
/** /**
* The return type of a method. * The return type of a method.
*/ */
public static final int CONTEXT_RETURN_TYPE = 16; RETURN_TYPE,
/** /**
* The return type of a method in a member summary. * The return type of a method in a member summary.
*/ */
public static final int CONTEXT_SUMMARY_RETURN_TYPE = 17; SUMMARY_RETURN_TYPE,
/** /**
* The type of a method/constructor parameter. * The type of a method/constructor parameter.
*/ */
public static final int CONTEXT_EXECUTABLE_MEMBER_PARAM = 18; EXECUTABLE_MEMBER_PARAM,
/** /**
* Super interface links. * Super interface links.
*/ */
public static final int CONTEXT_SUPER_INTERFACES = 19; SUPER_INTERFACES,
/** /**
* Implemented interface links. * Implemented interface links.
*/ */
public static final int CONTEXT_IMPLEMENTED_INTERFACES = 20; IMPLEMENTED_INTERFACES,
/** /**
* Implemented class links. * Implemented class links.
*/ */
public static final int CONTEXT_IMPLEMENTED_CLASSES = 21; IMPLEMENTED_CLASSES,
/** /**
* Subinterface links. * Subinterface links.
*/ */
public static final int CONTEXT_SUBINTERFACES = 22; SUBINTERFACES,
/** /**
* Subclasses links. * Subclasses links.
*/ */
public static final int CONTEXT_SUBCLASSES = 23; SUBCLASSES,
/** /**
* The signature in the class documentation (implements/extends portion). * The signature in the class documentation (implements/extends portion).
*/ */
public static final int CONTEXT_CLASS_SIGNATURE_PARENT_NAME = 24; CLASS_SIGNATURE_PARENT_NAME,
/** /**
* The header for method documentation copied from parent. * The header for method documentation copied from parent.
*/ */
public static final int CONTEXT_METHOD_DOC_COPY = 26; METHOD_DOC_COPY,
/** /**
* Method "specified by" link. * Method "specified by" link.
*/ */
public static final int CONTEXT_METHOD_SPECIFIED_BY = 27; METHOD_SPECIFIED_BY,
/** /**
* Method "overrides" link. * Method "overrides" link.
*/ */
public static final int CONTEXT_METHOD_OVERRIDES = 28; METHOD_OVERRIDES,
/** /**
* Annotation link. * Annotation link.
*/ */
public static final int CONTEXT_ANNOTATION = 29; ANNOTATION,
/** /**
* The header for field documentation copied from parent. * The header for field documentation copied from parent.
*/ */
public static final int CONTEXT_FIELD_DOC_COPY = 30; FIELD_DOC_COPY,
/** /**
* The parent nodes int the class tree. * The parent nodes in the class tree.
*/ */
public static final int CONTEXT_CLASS_TREE_PARENT = 31; CLASS_TREE_PARENT,
/** /**
* The type parameters of a method or constructor. * The type parameters of a method or constructor.
*/ */
public static final int CONTEXT_MEMBER_TYPE_PARAMS = 32; MEMBER_TYPE_PARAMS,
/** /**
* Indicate that the link appears in class use documentation. * Indicate that the link appears in class use documentation.
*/ */
public static final int CONTEXT_CLASS_USE_HEADER = 33; CLASS_USE_HEADER,
/** /**
* The header for property documentation copied from parent. * The header for property documentation copied from parent.
*/ */
public static final int CONTEXT_PROPERTY_DOC_COPY = 34; PROPERTY_DOC_COPY
}
public final ConfigurationImpl configuration; public final ConfigurationImpl configuration;
/** /**
* The integer indicating the location of the link. * The location of the link.
*/ */
public int context; public Kind context = Kind.DEFAULT;
/** /**
* The value of the marker #. * The value of the marker #.
@ -235,7 +239,7 @@ public class LinkInfoImpl extends LinkInfo {
* @param target the value of the target attribute. * @param target the value of the target attribute.
*/ */
public LinkInfoImpl(ConfigurationImpl configuration, public LinkInfoImpl(ConfigurationImpl configuration,
int context, ClassDoc classDoc, String label, String target) { Kind context, ClassDoc classDoc, String label, String target) {
this.configuration = configuration; this.configuration = configuration;
this.classDoc = classDoc; this.classDoc = classDoc;
this.label = label; this.label = label;
@ -255,7 +259,7 @@ public class LinkInfoImpl extends LinkInfo {
* @param styleName String style of text defined in style sheet. * @param styleName String style of text defined in style sheet.
*/ */
public LinkInfoImpl(ConfigurationImpl configuration, public LinkInfoImpl(ConfigurationImpl configuration,
int context, ClassDoc classDoc, String where, String label, Kind context, ClassDoc classDoc, String where, String label,
boolean isStrong, String styleName) { boolean isStrong, String styleName) {
this.configuration = configuration; this.configuration = configuration;
this.classDoc = classDoc; this.classDoc = classDoc;
@ -277,7 +281,7 @@ public class LinkInfoImpl extends LinkInfo {
* @param isStrong true if the link should be strong. * @param isStrong true if the link should be strong.
*/ */
public LinkInfoImpl(ConfigurationImpl configuration, public LinkInfoImpl(ConfigurationImpl configuration,
int context, ClassDoc classDoc, String where, String label, Kind context, ClassDoc classDoc, String where, String label,
boolean isStrong) { boolean isStrong) {
this.configuration = configuration; this.configuration = configuration;
this.classDoc = classDoc; this.classDoc = classDoc;
@ -311,7 +315,7 @@ public class LinkInfoImpl extends LinkInfo {
* @param isStrong true if the link should be strong. * @param isStrong true if the link should be strong.
*/ */
public LinkInfoImpl(ConfigurationImpl configuration, public LinkInfoImpl(ConfigurationImpl configuration,
int context, ExecutableMemberDoc executableMemberDoc, Kind context, ExecutableMemberDoc executableMemberDoc,
boolean isStrong) { boolean isStrong) {
this.configuration = configuration; this.configuration = configuration;
this.executableMemberDoc = executableMemberDoc; this.executableMemberDoc = executableMemberDoc;
@ -328,7 +332,7 @@ public class LinkInfoImpl extends LinkInfo {
* @param isStrong true if the link should be strong. * @param isStrong true if the link should be strong.
*/ */
public LinkInfoImpl(ConfigurationImpl configuration, public LinkInfoImpl(ConfigurationImpl configuration,
int context, ClassDoc classDoc, boolean isStrong) { Kind context, ClassDoc classDoc, boolean isStrong) {
this.configuration = configuration; this.configuration = configuration;
this.classDoc = classDoc; this.classDoc = classDoc;
this.isStrong = isStrong; this.isStrong = isStrong;
@ -343,7 +347,7 @@ public class LinkInfoImpl extends LinkInfo {
* @param type the class to link to. * @param type the class to link to.
*/ */
public LinkInfoImpl(ConfigurationImpl configuration, public LinkInfoImpl(ConfigurationImpl configuration,
int context, Type type) { Kind context, Type type) {
this.configuration = configuration; this.configuration = configuration;
this.type = type; this.type = type;
setContext(context); setContext(context);
@ -358,7 +362,7 @@ public class LinkInfoImpl extends LinkInfo {
* @param isVarArg true if this is a link to a var arg. * @param isVarArg true if this is a link to a var arg.
*/ */
public LinkInfoImpl(ConfigurationImpl configuration, public LinkInfoImpl(ConfigurationImpl configuration,
int context, Type type, boolean isVarArg) { Kind context, Type type, boolean isVarArg) {
this.configuration = configuration; this.configuration = configuration;
this.type = type; this.type = type;
this.isVarArg = isVarArg; this.isVarArg = isVarArg;
@ -375,7 +379,7 @@ public class LinkInfoImpl extends LinkInfo {
* @param isStrong true if the link should be strong. * @param isStrong true if the link should be strong.
*/ */
public LinkInfoImpl(ConfigurationImpl configuration, public LinkInfoImpl(ConfigurationImpl configuration,
int context, Type type, String label, Kind context, Type type, String label,
boolean isStrong) { boolean isStrong) {
this.configuration = configuration; this.configuration = configuration;
this.type = type; this.type = type;
@ -394,7 +398,7 @@ public class LinkInfoImpl extends LinkInfo {
* @param isStrong true if the link should be strong. * @param isStrong true if the link should be strong.
*/ */
public LinkInfoImpl(ConfigurationImpl configuration, public LinkInfoImpl(ConfigurationImpl configuration,
int context, ClassDoc classDoc, String label, Kind context, ClassDoc classDoc, String label,
boolean isStrong) { boolean isStrong) {
this.configuration = configuration; this.configuration = configuration;
this.classDoc = classDoc; this.classDoc = classDoc;
@ -406,7 +410,7 @@ public class LinkInfoImpl extends LinkInfo {
/** /**
* {@inheritDoc} * {@inheritDoc}
*/ */
public int getContext() { public Kind getContext() {
return context; return context;
} }
@ -418,56 +422,56 @@ public class LinkInfoImpl extends LinkInfo {
* *
* @param c the context id to set. * @param c the context id to set.
*/ */
public void setContext(int c) { public final void setContext(Kind c) {
//NOTE: Put context specific link code here. //NOTE: Put context specific link code here.
switch (c) { switch (c) {
case ALL_CLASSES_FRAME: case ALL_CLASSES_FRAME:
case PACKAGE_FRAME: case PACKAGE_FRAME:
case CONTEXT_IMPLEMENTED_CLASSES: case IMPLEMENTED_CLASSES:
case CONTEXT_SUBCLASSES: case SUBCLASSES:
case CONTEXT_METHOD_DOC_COPY: case METHOD_DOC_COPY:
case CONTEXT_FIELD_DOC_COPY: case FIELD_DOC_COPY:
case CONTEXT_PROPERTY_DOC_COPY: case PROPERTY_DOC_COPY:
case CONTEXT_CLASS_USE_HEADER: case CLASS_USE_HEADER:
includeTypeInClassLinkLabel = false; includeTypeInClassLinkLabel = false;
break; break;
case CONTEXT_ANNOTATION: case ANNOTATION:
excludeTypeParameterLinks = true; excludeTypeParameterLinks = true;
excludeTypeBounds = true; excludeTypeBounds = true;
break; break;
case CONTEXT_IMPLEMENTED_INTERFACES: case IMPLEMENTED_INTERFACES:
case CONTEXT_SUPER_INTERFACES: case SUPER_INTERFACES:
case CONTEXT_SUBINTERFACES: case SUBINTERFACES:
case CONTEXT_CLASS_TREE_PARENT: case CLASS_TREE_PARENT:
case CONTEXT_TREE: case TREE:
case CONTEXT_CLASS_SIGNATURE_PARENT_NAME: case CLASS_SIGNATURE_PARENT_NAME:
excludeTypeParameterLinks = true; excludeTypeParameterLinks = true;
excludeTypeBounds = true; excludeTypeBounds = true;
includeTypeInClassLinkLabel = false; includeTypeInClassLinkLabel = false;
includeTypeAsSepLink = true; includeTypeAsSepLink = true;
break; break;
case CONTEXT_PACKAGE: case PACKAGE:
case CONTEXT_CLASS_USE: case CLASS_USE:
case CONTEXT_CLASS_HEADER: case CLASS_HEADER:
case CONTEXT_CLASS_SIGNATURE: case CLASS_SIGNATURE:
excludeTypeParameterLinks = true; excludeTypeParameterLinks = true;
includeTypeAsSepLink = true; includeTypeAsSepLink = true;
includeTypeInClassLinkLabel = false; includeTypeInClassLinkLabel = false;
break; break;
case CONTEXT_MEMBER_TYPE_PARAMS: case MEMBER_TYPE_PARAMS:
includeTypeAsSepLink = true; includeTypeAsSepLink = true;
includeTypeInClassLinkLabel = false; includeTypeInClassLinkLabel = false;
break; break;
case CONTEXT_RETURN_TYPE: case RETURN_TYPE:
case CONTEXT_SUMMARY_RETURN_TYPE: case SUMMARY_RETURN_TYPE:
excludeTypeBounds = true; excludeTypeBounds = true;
break; break;
case CONTEXT_EXECUTABLE_MEMBER_PARAM: case EXECUTABLE_MEMBER_PARAM:
excludeTypeBounds = true; excludeTypeBounds = true;
break; break;
} }

View File

@ -153,7 +153,7 @@ public class MethodWriterImpl extends AbstractExecutableMemberWriter
writer.addInlineComment(method, methodDocTree); writer.addInlineComment(method, methodDocTree);
} else { } else {
Content link = new RawHtml( Content link = new RawHtml(
writer.getDocLink(LinkInfoImpl.CONTEXT_METHOD_DOC_COPY, writer.getDocLink(LinkInfoImpl.Kind.METHOD_DOC_COPY,
holder.asClassDoc(), method, holder.asClassDoc(), method,
holder.asClassDoc().isIncluded() ? holder.asClassDoc().isIncluded() ?
holder.typeName() : holder.qualifiedTypeName(), holder.typeName() : holder.qualifiedTypeName(),
@ -261,7 +261,7 @@ public class MethodWriterImpl extends AbstractExecutableMemberWriter
*/ */
public void addInheritedSummaryLabel(ClassDoc cd, Content inheritedTree) { public void addInheritedSummaryLabel(ClassDoc cd, Content inheritedTree) {
Content classLink = new RawHtml(writer.getPreQualifiedClassLink( Content classLink = new RawHtml(writer.getPreQualifiedClassLink(
LinkInfoImpl.CONTEXT_MEMBER, cd, false)); LinkInfoImpl.Kind.MEMBER, cd, false));
Content label = new StringContent(cd.isClass() ? Content label = new StringContent(cd.isClass() ?
configuration.getText("doclet.Methods_Inherited_From_Class") : configuration.getText("doclet.Methods_Inherited_From_Class") :
configuration.getText("doclet.Methods_Inherited_From_Interface")); configuration.getText("doclet.Methods_Inherited_From_Interface"));
@ -300,14 +300,14 @@ public class MethodWriterImpl extends AbstractExecutableMemberWriter
return; return;
} }
Content label = writer.overridesLabel; Content label = writer.overridesLabel;
int context = LinkInfoImpl.CONTEXT_METHOD_OVERRIDES; LinkInfoImpl.Kind context = LinkInfoImpl.Kind.METHOD_OVERRIDES;
if (method != null) { if (method != null) {
if (overriddenType.asClassDoc().isAbstract() && method.isAbstract()){ if (overriddenType.asClassDoc().isAbstract() && method.isAbstract()){
//Abstract method is implemented from abstract class, //Abstract method is implemented from abstract class,
//not overridden //not overridden
label = writer.specifiedByLabel; label = writer.specifiedByLabel;
context = LinkInfoImpl.CONTEXT_METHOD_SPECIFIED_BY; context = LinkInfoImpl.Kind.METHOD_SPECIFIED_BY;
} }
Content dt = HtmlTree.DT(HtmlTree.STRONG(label)); Content dt = HtmlTree.DT(HtmlTree.STRONG(label));
dl.addContent(dt); dl.addContent(dt);
@ -316,7 +316,7 @@ public class MethodWriterImpl extends AbstractExecutableMemberWriter
Content codeOverridenTypeLink = HtmlTree.CODE(overriddenTypeLink); Content codeOverridenTypeLink = HtmlTree.CODE(overriddenTypeLink);
String name = method.name(); String name = method.name();
Content methlink = new RawHtml(writer.getLink( Content methlink = new RawHtml(writer.getLink(
new LinkInfoImpl(writer.configuration, LinkInfoImpl.CONTEXT_MEMBER, new LinkInfoImpl(writer.configuration, LinkInfoImpl.Kind.MEMBER,
overriddenType.asClassDoc(), overriddenType.asClassDoc(),
writer.getAnchor(method), name, false))); writer.getAnchor(method), name, false)));
Content codeMethLink = HtmlTree.CODE(methlink); Content codeMethLink = HtmlTree.CODE(methlink);
@ -362,12 +362,12 @@ public class MethodWriterImpl extends AbstractExecutableMemberWriter
MethodDoc implementedMeth = implementedMethods[i]; MethodDoc implementedMeth = implementedMethods[i];
Type intfac = implementedMethodsFinder.getMethodHolder(implementedMeth); Type intfac = implementedMethodsFinder.getMethodHolder(implementedMeth);
Content intfaclink = new RawHtml(writer.getLink(new LinkInfoImpl( Content intfaclink = new RawHtml(writer.getLink(new LinkInfoImpl(
writer.configuration, LinkInfoImpl.CONTEXT_METHOD_SPECIFIED_BY, intfac))); writer.configuration, LinkInfoImpl.Kind.METHOD_SPECIFIED_BY, intfac)));
Content codeIntfacLink = HtmlTree.CODE(intfaclink); Content codeIntfacLink = HtmlTree.CODE(intfaclink);
Content dt = HtmlTree.DT(HtmlTree.STRONG(writer.specifiedByLabel)); Content dt = HtmlTree.DT(HtmlTree.STRONG(writer.specifiedByLabel));
dl.addContent(dt); dl.addContent(dt);
Content methlink = new RawHtml(writer.getDocLink( Content methlink = new RawHtml(writer.getDocLink(
LinkInfoImpl.CONTEXT_MEMBER, implementedMeth, LinkInfoImpl.Kind.MEMBER, implementedMeth,
implementedMeth.name(), false)); implementedMeth.name(), false));
Content codeMethLink = HtmlTree.CODE(methlink); Content codeMethLink = HtmlTree.CODE(methlink);
Content dd = HtmlTree.DD(codeMethLink); Content dd = HtmlTree.DD(codeMethLink);
@ -389,7 +389,7 @@ public class MethodWriterImpl extends AbstractExecutableMemberWriter
Type type = method.returnType(); Type type = method.returnType();
if (type != null) { if (type != null) {
Content linkContent = new RawHtml(writer.getLink( Content linkContent = new RawHtml(writer.getLink(
new LinkInfoImpl(configuration, LinkInfoImpl.CONTEXT_RETURN_TYPE, type))); new LinkInfoImpl(configuration, LinkInfoImpl.Kind.RETURN_TYPE, type)));
htmltree.addContent(linkContent); htmltree.addContent(linkContent);
htmltree.addContent(writer.getSpace()); htmltree.addContent(writer.getSpace());
} }

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -149,7 +149,7 @@ public class NestedClassWriterImpl extends AbstractMemberWriter
*/ */
public void addInheritedSummaryLabel(ClassDoc cd, Content inheritedTree) { public void addInheritedSummaryLabel(ClassDoc cd, Content inheritedTree) {
Content classLink = new RawHtml(writer.getPreQualifiedClassLink( Content classLink = new RawHtml(writer.getPreQualifiedClassLink(
LinkInfoImpl.CONTEXT_MEMBER, cd, false)); LinkInfoImpl.Kind.MEMBER, cd, false));
Content label = new StringContent(cd.isInterface() ? Content label = new StringContent(cd.isInterface() ?
configuration.getText("doclet.Nested_Classes_Interface_Inherited_From_Interface") : configuration.getText("doclet.Nested_Classes_Interface_Inherited_From_Interface") :
configuration.getText("doclet.Nested_Classes_Interfaces_Inherited_From_Class")); configuration.getText("doclet.Nested_Classes_Interfaces_Inherited_From_Class"));
@ -163,7 +163,7 @@ public class NestedClassWriterImpl extends AbstractMemberWriter
/** /**
* {@inheritDoc} * {@inheritDoc}
*/ */
protected void addSummaryLink(int context, ClassDoc cd, ProgramElementDoc member, protected void addSummaryLink(LinkInfoImpl.Kind context, ClassDoc cd, ProgramElementDoc member,
Content tdSummary) { Content tdSummary) {
Content strong = HtmlTree.STRONG(new RawHtml( Content strong = HtmlTree.STRONG(new RawHtml(
writer.getLink(new LinkInfoImpl(configuration, context, (ClassDoc)member, false)))); writer.getLink(new LinkInfoImpl(configuration, context, (ClassDoc)member, false))));
@ -177,7 +177,7 @@ public class NestedClassWriterImpl extends AbstractMemberWriter
protected void addInheritedSummaryLink(ClassDoc cd, protected void addInheritedSummaryLink(ClassDoc cd,
ProgramElementDoc member, Content linksTree) { ProgramElementDoc member, Content linksTree) {
linksTree.addContent(new RawHtml( linksTree.addContent(new RawHtml(
writer.getLink(new LinkInfoImpl(configuration, LinkInfoImpl.CONTEXT_MEMBER, writer.getLink(new LinkInfoImpl(configuration, LinkInfoImpl.Kind.MEMBER,
(ClassDoc)member, false)))); (ClassDoc)member, false))));
} }
@ -194,7 +194,7 @@ public class NestedClassWriterImpl extends AbstractMemberWriter
* {@inheritDoc} * {@inheritDoc}
*/ */
protected Content getDeprecatedLink(ProgramElementDoc member) { protected Content getDeprecatedLink(ProgramElementDoc member) {
return writer.getQualifiedClassLink(LinkInfoImpl.CONTEXT_MEMBER, return writer.getQualifiedClassLink(LinkInfoImpl.Kind.MEMBER,
(ClassDoc)member); (ClassDoc)member);
} }

View File

@ -183,7 +183,7 @@ public class PackageFrameWriter extends HtmlDocletWriter {
printedHeader = true; printedHeader = true;
} }
Content link = new RawHtml (getLink(new LinkInfoImpl(configuration, Content link = new RawHtml (getLink(new LinkInfoImpl(configuration,
LinkInfoImpl.PACKAGE_FRAME, arr[i], LinkInfoImpl.Kind.PACKAGE_FRAME, arr[i],
(arr[i].isInterface() ? italicsText(arr[i].name()) : (arr[i].isInterface() ? italicsText(arr[i].name()) :
arr[i].name()),"classFrame"))); arr[i].name()),"classFrame")));
Content li = HtmlTree.LI(link); Content li = HtmlTree.LI(link);

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -179,7 +179,7 @@ public class PackageWriterImpl extends HtmlDocletWriter
continue; continue;
} }
Content classContent = new RawHtml(getLink(new LinkInfoImpl( Content classContent = new RawHtml(getLink(new LinkInfoImpl(
configuration, LinkInfoImpl.CONTEXT_PACKAGE, classes[i], configuration, LinkInfoImpl.Kind.PACKAGE, classes[i],
false))); false)));
Content tdClass = HtmlTree.TD(HtmlStyle.colFirst, classContent); Content tdClass = HtmlTree.TD(HtmlStyle.colFirst, classContent);
HtmlTree tr = HtmlTree.TR(tdClass); HtmlTree tr = HtmlTree.TR(tdClass);

View File

@ -174,7 +174,7 @@ public class ProfilePackageFrameWriter extends HtmlDocletWriter {
printedHeader = true; printedHeader = true;
} }
Content link = new RawHtml (getLink(new LinkInfoImpl(configuration, Content link = new RawHtml (getLink(new LinkInfoImpl(configuration,
LinkInfoImpl.PACKAGE_FRAME, arr[i], LinkInfoImpl.Kind.PACKAGE_FRAME, arr[i],
(arr[i].isInterface() ? italicsText(arr[i].name()) : (arr[i].isInterface() ? italicsText(arr[i].name()) :
arr[i].name()),"classFrame"))); arr[i].name()),"classFrame")));
Content li = HtmlTree.LI(link); Content li = HtmlTree.LI(link);

View File

@ -99,7 +99,7 @@ public class PropertyWriterImpl extends AbstractMemberWriter
writer.addAnnotationInfo(property, pre); writer.addAnnotationInfo(property, pre);
addModifiers(property, pre); addModifiers(property, pre);
Content propertylink = new RawHtml(writer.getLink(new LinkInfoImpl( Content propertylink = new RawHtml(writer.getLink(new LinkInfoImpl(
configuration, LinkInfoImpl.CONTEXT_MEMBER, configuration, LinkInfoImpl.Kind.MEMBER,
property.returnType()))); property.returnType())));
pre.addContent(propertylink); pre.addContent(propertylink);
pre.addContent(" "); pre.addContent(" ");
@ -129,7 +129,7 @@ public class PropertyWriterImpl extends AbstractMemberWriter
writer.addInlineComment(property, propertyDocTree); writer.addInlineComment(property, propertyDocTree);
} else { } else {
Content link = new RawHtml( Content link = new RawHtml(
writer.getDocLink(LinkInfoImpl.CONTEXT_PROPERTY_DOC_COPY, writer.getDocLink(LinkInfoImpl.Kind.PROPERTY_DOC_COPY,
holder, property, holder, property,
holder.isIncluded() ? holder.isIncluded() ?
holder.typeName() : holder.qualifiedTypeName(), holder.typeName() : holder.qualifiedTypeName(),
@ -236,7 +236,7 @@ public class PropertyWriterImpl extends AbstractMemberWriter
*/ */
public void addInheritedSummaryLabel(ClassDoc cd, Content inheritedTree) { public void addInheritedSummaryLabel(ClassDoc cd, Content inheritedTree) {
Content classLink = new RawHtml(writer.getPreQualifiedClassLink( Content classLink = new RawHtml(writer.getPreQualifiedClassLink(
LinkInfoImpl.CONTEXT_MEMBER, cd, false)); LinkInfoImpl.Kind.MEMBER, cd, false));
Content label = new StringContent(cd.isClass() ? Content label = new StringContent(cd.isClass() ?
configuration.getText("doclet.Properties_Inherited_From_Class") : configuration.getText("doclet.Properties_Inherited_From_Class") :
configuration.getText("doclet.Properties_Inherited_From_Interface")); configuration.getText("doclet.Properties_Inherited_From_Interface"));
@ -250,7 +250,7 @@ public class PropertyWriterImpl extends AbstractMemberWriter
/** /**
* {@inheritDoc} * {@inheritDoc}
*/ */
protected void addSummaryLink(int context, ClassDoc cd, ProgramElementDoc member, protected void addSummaryLink(LinkInfoImpl.Kind context, ClassDoc cd, ProgramElementDoc member,
Content tdSummary) { Content tdSummary) {
Content strong = HtmlTree.STRONG(new RawHtml( Content strong = HtmlTree.STRONG(new RawHtml(
writer.getDocLink(context, writer.getDocLink(context,
@ -270,7 +270,7 @@ public class PropertyWriterImpl extends AbstractMemberWriter
protected void addInheritedSummaryLink(ClassDoc cd, protected void addInheritedSummaryLink(ClassDoc cd,
ProgramElementDoc member, Content linksTree) { ProgramElementDoc member, Content linksTree) {
linksTree.addContent(new RawHtml( linksTree.addContent(new RawHtml(
writer.getDocLink(LinkInfoImpl.CONTEXT_MEMBER, cd, (MemberDoc)member, writer.getDocLink(LinkInfoImpl.Kind.MEMBER, cd, (MemberDoc)member,
((member.name().lastIndexOf("Property") != -1) && configuration.javafx) ((member.name().lastIndexOf("Property") != -1) && configuration.javafx)
? member.name().substring(0, member.name().length() - "Property".length()) ? member.name().substring(0, member.name().length() - "Property".length())
: member.name(), : member.name(),
@ -289,7 +289,7 @@ public class PropertyWriterImpl extends AbstractMemberWriter
* {@inheritDoc} * {@inheritDoc}
*/ */
protected Content getDeprecatedLink(ProgramElementDoc member) { protected Content getDeprecatedLink(ProgramElementDoc member) {
return writer.getDocLink(LinkInfoImpl.CONTEXT_MEMBER, return writer.getDocLink(LinkInfoImpl.Kind.MEMBER,
(MemberDoc) member, ((MethodDoc)member).qualifiedName()); (MemberDoc) member, ((MethodDoc)member).qualifiedName());
} }

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -136,7 +136,7 @@ public class SerializedFormWriterImpl extends SubWriterHolderWriter
String superClassLink = String superClassLink =
classDoc.superclassType() != null ? classDoc.superclassType() != null ?
getLink(new LinkInfoImpl(configuration, getLink(new LinkInfoImpl(configuration,
LinkInfoImpl.CONTEXT_SERIALIZED_FORM, LinkInfoImpl.Kind.SERIALIZED_FORM,
classDoc.superclassType())) : classDoc.superclassType())) :
null; null;

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -247,7 +247,7 @@ public class TagletWriterImpl extends TagletWriter {
result += throwsTag.exceptionType() == null ? result += throwsTag.exceptionType() == null ?
htmlWriter.codeText(throwsTag.exceptionName()) : htmlWriter.codeText(throwsTag.exceptionName()) :
htmlWriter.codeText( htmlWriter.codeText(
htmlWriter.getLink(new LinkInfoImpl(configuration, LinkInfoImpl.CONTEXT_MEMBER, htmlWriter.getLink(new LinkInfoImpl(configuration, LinkInfoImpl.Kind.MEMBER,
throwsTag.exceptionType()))); throwsTag.exceptionType())));
TagletOutput text = new TagletOutputImpl( TagletOutput text = new TagletOutputImpl(
htmlWriter.commentTagsToString(throwsTag, null, htmlWriter.commentTagsToString(throwsTag, null,
@ -265,7 +265,7 @@ public class TagletWriterImpl extends TagletWriter {
public TagletOutput throwsTagOutput(Type throwsType) { public TagletOutput throwsTagOutput(Type throwsType) {
return new TagletOutputImpl(DocletConstants.NL + "<dd>" + return new TagletOutputImpl(DocletConstants.NL + "<dd>" +
htmlWriter.codeText(htmlWriter.getLink( htmlWriter.codeText(htmlWriter.getLink(
new LinkInfoImpl(configuration, LinkInfoImpl.CONTEXT_MEMBER, throwsType))) + "</dd>"); new LinkInfoImpl(configuration, LinkInfoImpl.Kind.MEMBER, throwsType))) + "</dd>");
} }
/** /**
@ -274,7 +274,7 @@ public class TagletWriterImpl extends TagletWriter {
public TagletOutput valueTagOutput(FieldDoc field, String constantVal, public TagletOutput valueTagOutput(FieldDoc field, String constantVal,
boolean includeLink) { boolean includeLink) {
return new TagletOutputImpl(includeLink ? return new TagletOutputImpl(includeLink ?
htmlWriter.getDocLink(LinkInfoImpl.CONTEXT_VALUE_TAG, field, htmlWriter.getDocLink(LinkInfoImpl.Kind.VALUE_TAG, field,
constantVal, false) : constantVal); constantVal, false) : constantVal);
} }

View File

@ -120,21 +120,6 @@ public abstract class LinkInfo {
*/ */
public int displayLength = 0; public int displayLength = 0;
/**
* Return the id indicating where the link appears in the documentation.
* This is used for special processing of different types of links.
*
* @return the id indicating where the link appears in the documentation.
*/
public abstract int getContext();
/**
* Set the context.
*
* @param c the context id to set.
*/
public abstract void setContext(int c);
/** /**
* Return true if this link is linkable and false if we can't link to the * Return true if this link is linkable and false if we can't link to the
* desired place. * desired place.