8010440: Replace int constants in LinkInfoImpl with enum
Reviewed-by: bpatel, darcy
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AbstractExecutableMemberWriter.java Fri May 10 15:15:50 2013 +0200
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AbstractExecutableMemberWriter.java Tue May 14 10:14:51 2013 -0700
@@ -62,7 +62,7 @@
*/
protected int addTypeParameters(ExecutableMemberDoc member, Content htmltree) {
LinkInfoImpl linkInfo = new LinkInfoImpl(configuration,
- LinkInfoImpl.CONTEXT_MEMBER_TYPE_PARAMS, member, false);
+ LinkInfoImpl.Kind.MEMBER_TYPE_PARAMS, member, false);
String typeParameters = writer.getTypeParameterLinks(linkInfo);
if (linkInfo.displayLength > 0) {
Content linkContent = new RawHtml(typeParameters);
@@ -78,7 +78,7 @@
*/
protected Content getDeprecatedLink(ProgramElementDoc 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());
}
@@ -90,7 +90,7 @@
* @param member the member being linked to
* @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) {
ExecutableMemberDoc emd = (ExecutableMemberDoc)member;
String name = emd.name();
@@ -113,7 +113,7 @@
protected void addInheritedSummaryLink(ClassDoc cd,
ProgramElementDoc member, Content linksTree) {
linksTree.addContent(new RawHtml(
- writer.getDocLink(LinkInfoImpl.CONTEXT_MEMBER, cd, (MemberDoc) member,
+ writer.getDocLink(LinkInfoImpl.Kind.MEMBER, cd, (MemberDoc) member,
member.name(), false)));
}
@@ -129,7 +129,7 @@
boolean isVarArg, Content tree) {
if (param.type() != null) {
Content link = new RawHtml(writer.getLink(new LinkInfoImpl(
- configuration, LinkInfoImpl.CONTEXT_EXECUTABLE_MEMBER_PARAM,
+ configuration, LinkInfoImpl.Kind.EXECUTABLE_MEMBER_PARAM,
param.type(), isVarArg)));
tree.addContent(link);
}
@@ -153,7 +153,7 @@
tree.addContent(writer.getSpace());
tree.addContent(rcvrType.typeName());
LinkInfoImpl linkInfo = new LinkInfoImpl(configuration,
- LinkInfoImpl.CONTEXT_CLASS_SIGNATURE, rcvrType);
+ LinkInfoImpl.Kind.CLASS_SIGNATURE, rcvrType);
tree.addContent(new RawHtml(writer.getTypeParameterLinks(linkInfo)));
tree.addContent(writer.getSpace());
tree.addContent("this");
@@ -244,7 +244,7 @@
Type[] exceptions = member.thrownExceptionTypes();
if(exceptions.length > 0) {
LinkInfoImpl memberTypeParam = new LinkInfoImpl(configuration,
- LinkInfoImpl.CONTEXT_MEMBER, member, false);
+ LinkInfoImpl.Kind.MEMBER, member, false);
int retlen = getReturnTypeLength(member);
writer.getTypeParameterLinks(memberTypeParam);
retlen += memberTypeParam.displayLength == 0 ?
@@ -256,14 +256,14 @@
htmltree.addContent("throws ");
indent += " ";
Content link = new RawHtml(writer.getLink(new LinkInfoImpl(configuration,
- LinkInfoImpl.CONTEXT_MEMBER, exceptions[0])));
+ LinkInfoImpl.Kind.MEMBER, exceptions[0])));
htmltree.addContent(link);
for(int i = 1; i < exceptions.length; i++) {
htmltree.addContent(",");
htmltree.addContent(DocletConstants.NL);
htmltree.addContent(indent);
Content exceptionLink = new RawHtml(writer.getLink(new LinkInfoImpl(
- configuration, LinkInfoImpl.CONTEXT_MEMBER, exceptions[i])));
+ configuration, LinkInfoImpl.Kind.MEMBER, exceptions[i])));
htmltree.addContent(exceptionLink);
}
}
@@ -278,7 +278,7 @@
rettype.dimension().length();
} else {
LinkInfoImpl linkInfo = new LinkInfoImpl(configuration,
- LinkInfoImpl.CONTEXT_MEMBER, rettype);
+ LinkInfoImpl.Kind.MEMBER, rettype);
writer.getLink(linkInfo);
return linkInfo.displayLength;
}
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AbstractIndexWriter.java Fri May 10 15:15:50 2013 +0200
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AbstractIndexWriter.java Tue May 14 10:14:51 2013 -0700
@@ -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.
*
* This code is free software; you can redistribute it and/or modify it
@@ -141,7 +141,7 @@
protected void addDescription(ClassDoc cd, Content dlTree) {
Content link = new RawHtml(
getLink(new LinkInfoImpl(configuration,
- LinkInfoImpl.CONTEXT_INDEX, cd, true)));
+ LinkInfoImpl.Kind.INDEX, cd, true)));
Content dt = HtmlTree.DT(link);
dt.addContent(" - ");
addClassInfo(cd, dt);
@@ -152,7 +152,7 @@
}
/**
- * Add the classkind(class, interface, exception, error of the class
+ * Add the classkind (class, interface, exception), error of the class
* passed.
*
* @param cd the class being documented
@@ -179,7 +179,7 @@
name = Util.escapeHtmlChars(name);
}
Content span = HtmlTree.SPAN(HtmlStyle.strong,
- getDocLink(LinkInfoImpl.CONTEXT_INDEX, member, name));
+ getDocLink(LinkInfoImpl.Kind.INDEX, member, name));
Content dt = HtmlTree.DT(span);
dt.addContent(" - ");
addMemberDesc(member, dt);
@@ -253,7 +253,7 @@
getResource("doclet.Method_in", classdesc));
}
}
- addPreQualifiedClassLink(LinkInfoImpl.CONTEXT_INDEX, containing,
+ addPreQualifiedClassLink(LinkInfoImpl.Kind.INDEX, containing,
false, contentTree);
}
}
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AbstractMemberWriter.java Fri May 10 15:15:50 2013 +0200
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AbstractMemberWriter.java Tue May 14 10:14:51 2013 -0700
@@ -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.
*
* This code is free software; you can redistribute it and/or modify it
@@ -143,7 +143,7 @@
*/
protected void addSummaryLink(ClassDoc cd, ProgramElementDoc member,
Content tdSummary) {
- addSummaryLink(LinkInfoImpl.CONTEXT_MEMBER, cd, member, tdSummary);
+ addSummaryLink(LinkInfoImpl.Kind.MEMBER, cd, member, tdSummary);
}
/**
@@ -154,7 +154,7 @@
* @param member the member to be documented
* @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);
/**
@@ -294,11 +294,11 @@
}
code.addContent(new RawHtml(
writer.getLink(new LinkInfoImpl(configuration,
- LinkInfoImpl.CONTEXT_SUMMARY_RETURN_TYPE, type))));
+ LinkInfoImpl.Kind.SUMMARY_RETURN_TYPE, type))));
} else {
code.addContent(new RawHtml(
writer.getLink(new LinkInfoImpl(configuration,
- LinkInfoImpl.CONTEXT_SUMMARY_RETURN_TYPE, type))));
+ LinkInfoImpl.Kind.SUMMARY_RETURN_TYPE, type))));
}
}
@@ -483,7 +483,7 @@
tdLast.addContent(name);
}
addSummaryLink(pgmdoc instanceof ClassDoc ?
- LinkInfoImpl.CONTEXT_CLASS_USE : LinkInfoImpl.CONTEXT_MEMBER,
+ LinkInfoImpl.Kind.CLASS_USE : LinkInfoImpl.Kind.MEMBER,
cd, pgmdoc, tdLast);
writer.addSummaryLinkComment(this, pgmdoc, tdLast);
tr.addContent(tdLast);
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AbstractTreeWriter.java Fri May 10 15:15:50 2013 +0200
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AbstractTreeWriter.java Tue May 14 10:14:51 2013 -0700
@@ -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.
*
* This code is free software; you can redistribute it and/or modify it
@@ -152,7 +152,7 @@
} else {
contentTree.addContent(", ");
}
- addPreQualifiedClassLink(LinkInfoImpl.CONTEXT_TREE,
+ addPreQualifiedClassLink(LinkInfoImpl.Kind.TREE,
interfaces[i], contentTree);
counter++;
}
@@ -170,7 +170,7 @@
* @param contentTree the content tree to which the information will be added
*/
protected void addPartialInfo(ClassDoc cd, Content contentTree) {
- addPreQualifiedStrongClassLink(LinkInfoImpl.CONTEXT_TREE, cd, contentTree);
+ addPreQualifiedStrongClassLink(LinkInfoImpl.Kind.TREE, cd, contentTree);
}
/**
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AllClassesFrameWriter.java Fri May 10 15:15:50 2013 +0200
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AllClassesFrameWriter.java Tue May 14 10:14:51 2013 -0700
@@ -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.
*
* This code is free software; you can redistribute it and/or modify it
@@ -160,7 +160,7 @@
Content linkContent;
if(wantFrames){
linkContent = new RawHtml(getLink(new LinkInfoImpl(configuration,
- LinkInfoImpl.ALL_CLASSES_FRAME, cd, label, "classFrame")));
+ LinkInfoImpl.Kind.ALL_CLASSES_FRAME, cd, label, "classFrame")));
} else {
linkContent = new RawHtml(getLink(new LinkInfoImpl(
configuration, cd, label)));
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AnnotationTypeRequiredMemberWriterImpl.java Fri May 10 15:15:50 2013 +0200
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AnnotationTypeRequiredMemberWriterImpl.java Tue May 14 10:14:51 2013 -0700
@@ -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.
*
* This code is free software; you can redistribute it and/or modify it
@@ -107,7 +107,7 @@
addModifiers(member, pre);
Content link = new RawHtml(
writer.getLink(new LinkInfoImpl(configuration,
- LinkInfoImpl.CONTEXT_MEMBER, getType(member))));
+ LinkInfoImpl.Kind.MEMBER, getType(member))));
pre.addContent(link);
pre.addContent(writer.getSpace());
if (configuration.linksource) {
@@ -223,7 +223,7 @@
/**
* {@inheritDoc}
*/
- protected void addSummaryLink(int context, ClassDoc cd, ProgramElementDoc member,
+ protected void addSummaryLink(LinkInfoImpl.Kind context, ClassDoc cd, ProgramElementDoc member,
Content tdSummary) {
Content strong = HtmlTree.STRONG(new RawHtml(
writer.getDocLink(context, (MemberDoc) member, member.name(), false)));
@@ -251,7 +251,7 @@
* {@inheritDoc}
*/
protected Content getDeprecatedLink(ProgramElementDoc member) {
- return writer.getDocLink(LinkInfoImpl.CONTEXT_MEMBER,
+ return writer.getDocLink(LinkInfoImpl.Kind.MEMBER,
(MemberDoc) member, ((MemberDoc)member).qualifiedName());
}
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AnnotationTypeWriterImpl.java Fri May 10 15:15:50 2013 +0200
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AnnotationTypeWriterImpl.java Tue May 14 10:14:51 2013 -0700
@@ -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.
*
* This code is free software; you can redistribute it and/or modify it
@@ -117,7 +117,7 @@
Content li;
if (prev != null) {
Content prevLink = new RawHtml(getLink(new LinkInfoImpl(configuration,
- LinkInfoImpl.CONTEXT_CLASS, prev.asClassDoc(), "",
+ LinkInfoImpl.Kind.CLASS, prev.asClassDoc(), "",
configuration.getText("doclet.Prev_Class"), true)));
li = HtmlTree.LI(prevLink);
}
@@ -135,7 +135,7 @@
Content li;
if (next != null) {
Content nextLink = new RawHtml(getLink(new LinkInfoImpl(configuration,
- LinkInfoImpl.CONTEXT_CLASS, next.asClassDoc(), "",
+ LinkInfoImpl.Kind.CLASS, next.asClassDoc(), "",
configuration.getText("doclet.Next_Class"), true)));
li = HtmlTree.LI(nextLink);
}
@@ -163,7 +163,7 @@
div.addContent(pkgNameDiv);
}
LinkInfoImpl linkInfo = new LinkInfoImpl(configuration,
- LinkInfoImpl.CONTEXT_CLASS_HEADER, annotationType, false);
+ LinkInfoImpl.Kind.CLASS_HEADER, annotationType, false);
Content headerContent = new StringContent(header);
Content heading = HtmlTree.HEADING(HtmlConstants.CLASS_PAGE_HEADING, true,
HtmlStyle.title, headerContent);
@@ -220,7 +220,7 @@
addAnnotationInfo(annotationType, pre);
pre.addContent(modifiers);
LinkInfoImpl linkInfo = new LinkInfoImpl(configuration,
- LinkInfoImpl.CONTEXT_CLASS_SIGNATURE, annotationType, false);
+ LinkInfoImpl.Kind.CLASS_SIGNATURE, annotationType, false);
Content annotationName = new StringContent(annotationType.name());
Content parameterLinks = new RawHtml(getTypeParameterLinks(linkInfo));
if (configuration.linksource) {
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/ClassUseWriter.java Fri May 10 15:15:50 2013 +0200
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/ClassUseWriter.java Tue May 14 10:14:51 2013 -0700
@@ -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.
*
* This code is free software; you can redistribute it and/or modify it
@@ -258,7 +258,7 @@
Content table = HtmlTree.TABLE(0, 3, 0, useTableSummary,
getTableCaption(configuration.getText(
"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)))));
table.addContent(getSummaryTableHeader(packageTableHeader, "col"));
Content tbody = new HtmlTree(HtmlTag.TBODY);
@@ -294,7 +294,7 @@
getTableCaption(configuration.getText(
"doclet.ClassUse_PackageAnnotation",
getLink(new LinkInfoImpl(configuration,
- LinkInfoImpl.CONTEXT_CLASS_USE_HEADER, classdoc, false)))));
+ LinkInfoImpl.Kind.CLASS_USE_HEADER, classdoc, false)))));
table.addContent(getSummaryTableHeader(packageTableHeader, "col"));
Content tbody = new HtmlTree(HtmlTag.TBODY);
Iterator<PackageDoc> it = pkgToPackageAnnotations.iterator();
@@ -333,7 +333,7 @@
Content li = HtmlTree.LI(HtmlStyle.blockList, getMarkerAnchor(pkg.name()));
Content link = new RawHtml(
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)),
getPackageLinkString(pkg, Util.getPackageName(pkg), false)));
Content heading = HtmlTree.HEADING(HtmlConstants.SUMMARY_HEADING, link);
@@ -369,7 +369,7 @@
*/
protected void addClassUse(PackageDoc pkg, Content contentTree) throws IOException {
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);
classSubWriter.addUseInfo(pkgToClassAnnotations.get(pkg.name()),
configuration.getText("doclet.ClassUse_Annotation", classLink,
@@ -477,7 +477,7 @@
*/
protected Content getNavLinkClass() {
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)));
Content li = HtmlTree.LI(linkContent);
return li;
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/ClassWriterImpl.java Fri May 10 15:15:50 2013 +0200
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/ClassWriterImpl.java Tue May 14 10:14:51 2013 -0700
@@ -125,7 +125,7 @@
Content li;
if (prev != null) {
Content prevLink = new RawHtml(getLink(new LinkInfoImpl(configuration,
- LinkInfoImpl.CONTEXT_CLASS, prev, "",
+ LinkInfoImpl.Kind.CLASS, prev, "",
configuration.getText("doclet.Prev_Class"), true)));
li = HtmlTree.LI(prevLink);
}
@@ -143,7 +143,7 @@
Content li;
if (next != null) {
Content nextLink = new RawHtml(getLink(new LinkInfoImpl(configuration,
- LinkInfoImpl.CONTEXT_CLASS, next, "",
+ LinkInfoImpl.Kind.CLASS, next, "",
configuration.getText("doclet.Next_Class"), true)));
li = HtmlTree.LI(nextLink);
}
@@ -185,7 +185,7 @@
div.addContent(pkgNameDiv);
}
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.
linkInfo.linkToSelf = false;
Content headerContent = new StringContent(header);
@@ -245,7 +245,7 @@
addAnnotationInfo(classDoc, pre);
pre.addContent(modifiers);
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.
linkInfo.linkToSelf = false;
Content className = new StringContent(classDoc.name());
@@ -265,7 +265,7 @@
pre.addContent(DocletConstants.NL);
pre.addContent("extends ");
Content link = new RawHtml(getLink(new LinkInfoImpl(configuration,
- LinkInfoImpl.CONTEXT_CLASS_SIGNATURE_PARENT_NAME,
+ LinkInfoImpl.Kind.CLASS_SIGNATURE_PARENT_NAME,
superclass)));
pre.addContent(link);
}
@@ -286,7 +286,7 @@
pre.addContent(", ");
}
Content link = new RawHtml(getLink(new LinkInfoImpl(configuration,
- LinkInfoImpl.CONTEXT_CLASS_SIGNATURE_PARENT_NAME,
+ LinkInfoImpl.Kind.CLASS_SIGNATURE_PARENT_NAME,
implIntfacs[i])));
pre.addContent(link);
counter++;
@@ -361,7 +361,7 @@
Content li = new HtmlTree(HtmlTag.LI);
if (type.equals(classDoc)) {
String typeParameters = getTypeParameterLinks(
- new LinkInfoImpl(configuration, LinkInfoImpl.CONTEXT_TREE,
+ new LinkInfoImpl(configuration, LinkInfoImpl.Kind.TREE,
classDoc, false));
if (configuration.shouldExcludeQualifier(
classDoc.containingPackage().name())) {
@@ -373,7 +373,7 @@
}
} else {
Content link = new RawHtml(getLink(new LinkInfoImpl(configuration,
- LinkInfoImpl.CONTEXT_CLASS_TREE_PARENT,
+ LinkInfoImpl.Kind.CLASS_TREE_PARENT,
type instanceof ClassDoc ? (ClassDoc) type : type,
configuration.getClassName(type.asClassDoc()), false)));
li.addContent(link);
@@ -419,7 +419,7 @@
"doclet.Subclasses");
Content dt = HtmlTree.DT(label);
Content dl = HtmlTree.DL(dt);
- dl.addContent(getClassLinks(LinkInfoImpl.CONTEXT_SUBCLASSES,
+ dl.addContent(getClassLinks(LinkInfoImpl.Kind.SUBCLASSES,
subclasses));
classInfoTree.addContent(dl);
}
@@ -437,7 +437,7 @@
"doclet.Subinterfaces");
Content dt = HtmlTree.DT(label);
Content dl = HtmlTree.DL(dt);
- dl.addContent(getClassLinks(LinkInfoImpl.CONTEXT_SUBINTERFACES,
+ dl.addContent(getClassLinks(LinkInfoImpl.Kind.SUBINTERFACES,
subInterfaces));
classInfoTree.addContent(dl);
}
@@ -461,7 +461,7 @@
"doclet.Implementing_Classes");
Content dt = HtmlTree.DT(label);
Content dl = HtmlTree.DL(dt);
- dl.addContent(getClassLinks(LinkInfoImpl.CONTEXT_IMPLEMENTED_CLASSES,
+ dl.addContent(getClassLinks(LinkInfoImpl.Kind.IMPLEMENTED_CLASSES,
implcl));
classInfoTree.addContent(dl);
}
@@ -479,7 +479,7 @@
"doclet.All_Implemented_Interfaces");
Content dt = HtmlTree.DT(label);
Content dl = HtmlTree.DL(dt);
- dl.addContent(getClassLinks(LinkInfoImpl.CONTEXT_IMPLEMENTED_INTERFACES,
+ dl.addContent(getClassLinks(LinkInfoImpl.Kind.IMPLEMENTED_INTERFACES,
interfaceArray));
classInfoTree.addContent(dl);
}
@@ -497,7 +497,7 @@
"doclet.All_Superinterfaces");
Content dt = HtmlTree.DT(label);
Content dl = HtmlTree.DL(dt);
- dl.addContent(getClassLinks(LinkInfoImpl.CONTEXT_SUPER_INTERFACES,
+ dl.addContent(getClassLinks(LinkInfoImpl.Kind.SUPER_INTERFACES,
interfaceArray));
classInfoTree.addContent(dl);
}
@@ -521,7 +521,7 @@
Content dl = HtmlTree.DL(dt);
Content dd = new HtmlTree(HtmlTag.DD);
dd.addContent(new RawHtml(getLink(new LinkInfoImpl(configuration,
- LinkInfoImpl.CONTEXT_CLASS, outerClass, false))));
+ LinkInfoImpl.Kind.CLASS, outerClass, false))));
dl.addContent(dd);
classInfoTree.addContent(dl);
}
@@ -569,7 +569,7 @@
* @param list the list of classes
* @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();
Content dd = new HtmlTree(HtmlTag.DD);
for (int i = 0; i < list.size(); i++) {
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/ConstantsSummaryWriterImpl.java Fri May 10 15:15:50 2013 +0200
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/ConstantsSummaryWriterImpl.java Tue May 14 10:14:51 2013 -0700
@@ -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.
*
* This code is free software; you can redistribute it and/or modify it
@@ -186,7 +186,7 @@
//generate links backward only to public classes.
String classlink = (cd.isPublic() || cd.isProtected()) ?
getLink(new LinkInfoImpl(configuration,
- LinkInfoImpl.CONTEXT_CONSTANT_SUMMARY, cd, false)) :
+ LinkInfoImpl.Kind.CONSTANT_SUMMARY, cd, false)) :
cd.qualifiedName();
String name = cd.containingPackage().name();
if (name.length() > 0) {
@@ -261,7 +261,7 @@
code.addContent(getSpace());
}
Content type = new RawHtml(getLink(new LinkInfoImpl(configuration,
- LinkInfoImpl.CONTEXT_CONSTANT_SUMMARY, member.type())));
+ LinkInfoImpl.Kind.CONSTANT_SUMMARY, member.type())));
code.addContent(type);
tdType.addContent(code);
return tdType;
@@ -275,7 +275,7 @@
*/
private Content getNameColumn(FieldDoc member) {
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);
return HtmlTree.TD(code);
}
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/EnumConstantWriterImpl.java Fri May 10 15:15:50 2013 +0200
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/EnumConstantWriterImpl.java Tue May 14 10:14:51 2013 -0700
@@ -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.
*
* This code is free software; you can redistribute it and/or modify it
@@ -102,7 +102,7 @@
writer.addAnnotationInfo(enumConstant, pre);
addModifiers(enumConstant, pre);
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(" ");
if (configuration.linksource) {
@@ -220,7 +220,7 @@
/**
* {@inheritDoc}
*/
- protected void addSummaryLink(int context, ClassDoc cd, ProgramElementDoc member,
+ protected void addSummaryLink(LinkInfoImpl.Kind context, ClassDoc cd, ProgramElementDoc member,
Content tdSummary) {
Content strong = HtmlTree.STRONG(new RawHtml(
writer.getDocLink(context, (MemberDoc) member, member.name(), false)));
@@ -254,7 +254,7 @@
* {@inheritDoc}
*/
protected Content getDeprecatedLink(ProgramElementDoc member) {
- return writer.getDocLink(LinkInfoImpl.CONTEXT_MEMBER,
+ return writer.getDocLink(LinkInfoImpl.Kind.MEMBER,
(MemberDoc) member, ((FieldDoc)member).qualifiedName());
}
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/FieldWriterImpl.java Fri May 10 15:15:50 2013 +0200
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/FieldWriterImpl.java Tue May 14 10:14:51 2013 -0700
@@ -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.
*
* This code is free software; you can redistribute it and/or modify it
@@ -103,7 +103,7 @@
writer.addAnnotationInfo(field, pre);
addModifiers(field, pre);
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(" ");
if (configuration.linksource) {
@@ -133,7 +133,7 @@
writer.addInlineComment(field, fieldDocTree);
} else {
Content link = new RawHtml(
- writer.getDocLink(LinkInfoImpl.CONTEXT_FIELD_DOC_COPY,
+ writer.getDocLink(LinkInfoImpl.Kind.FIELD_DOC_COPY,
holder, field,
holder.isIncluded() ?
holder.typeName() : holder.qualifiedTypeName(),
@@ -240,7 +240,7 @@
*/
public void addInheritedSummaryLabel(ClassDoc cd, Content inheritedTree) {
Content classLink = new RawHtml(writer.getPreQualifiedClassLink(
- LinkInfoImpl.CONTEXT_MEMBER, cd, false));
+ LinkInfoImpl.Kind.MEMBER, cd, false));
Content label = new StringContent(cd.isClass() ?
configuration.getText("doclet.Fields_Inherited_From_Class") :
configuration.getText("doclet.Fields_Inherited_From_Interface"));
@@ -254,7 +254,7 @@
/**
* {@inheritDoc}
*/
- protected void addSummaryLink(int context, ClassDoc cd, ProgramElementDoc member,
+ protected void addSummaryLink(LinkInfoImpl.Kind context, ClassDoc cd, ProgramElementDoc member,
Content tdSummary) {
Content strong = HtmlTree.STRONG(new RawHtml(
writer.getDocLink(context, cd , (MemberDoc) member, member.name(), false)));
@@ -268,7 +268,7 @@
protected void addInheritedSummaryLink(ClassDoc cd,
ProgramElementDoc member, Content linksTree) {
linksTree.addContent(new RawHtml(
- writer.getDocLink(LinkInfoImpl.CONTEXT_MEMBER, cd, (MemberDoc)member,
+ writer.getDocLink(LinkInfoImpl.Kind.MEMBER, cd, (MemberDoc)member,
member.name(), false)));
}
@@ -284,7 +284,7 @@
* {@inheritDoc}
*/
protected Content getDeprecatedLink(ProgramElementDoc member) {
- return writer.getDocLink(LinkInfoImpl.CONTEXT_MEMBER,
+ return writer.getDocLink(LinkInfoImpl.Kind.MEMBER,
(MemberDoc) member, ((FieldDoc)member).qualifiedName());
}
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java Fri May 10 15:15:50 2013 +0200
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java Tue May 14 10:14:51 2013 -0700
@@ -373,7 +373,7 @@
continue;
}
Content classContent = new RawHtml(getLink(new LinkInfoImpl(
- configuration, LinkInfoImpl.CONTEXT_PACKAGE, classes[i],
+ configuration, LinkInfoImpl.Kind.PACKAGE, classes[i],
false)));
Content tdClass = HtmlTree.TD(HtmlStyle.colFirst, classContent);
HtmlTree tr = HtmlTree.TR(tdClass);
@@ -1191,7 +1191,7 @@
* @param cd the class doc to link to
* @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,
configuration.getClassName(cd), "")));
}
@@ -1203,7 +1203,7 @@
* @param cd the class doc to link to
* @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);
}
@@ -1216,7 +1216,7 @@
* @param isStrong true if the link should be strong.
* @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) {
String classlink = "";
PackageDoc pd = cd.containingPackage();
@@ -1238,7 +1238,7 @@
* @param isStrong true if the link should be strong
* @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) {
PackageDoc pd = cd.containingPackage();
if(pd != null && ! configuration.shouldExcludeQualifier(pd.name())) {
@@ -1256,7 +1256,7 @@
* @param cd the class to link to
* @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);
}
@@ -1268,7 +1268,7 @@
* @param label the label for the 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);
}
@@ -1281,7 +1281,7 @@
* @param strong true if the link should be strong.
* @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) {
return getDocLink(context, doc.containingClass(), doc, label, strong);
}
@@ -1298,7 +1298,7 @@
* @param strong true if the link should be strong.
* @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) {
return getDocLink(context, classDoc, doc, label, strong, false);
}
@@ -1316,7 +1316,7 @@
* @param isProperty true if the doc parameter is a JavaFX property.
* @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) {
if (! (doc.isIncluded() ||
Util.isLinkable(classDoc, configuration))) {
@@ -1344,7 +1344,7 @@
* @param label the label for the link
* @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) {
if (! (doc.isIncluded() ||
Util.isLinkable(classDoc, configuration))) {
@@ -1480,7 +1480,7 @@
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);
}
}
@@ -1998,7 +1998,7 @@
annotation = new StringBuilder();
isAnnotationDocumented = false;
LinkInfoImpl linkInfo = new LinkInfoImpl(configuration,
- LinkInfoImpl.CONTEXT_ANNOTATION, annotationDoc);
+ LinkInfoImpl.Kind.ANNOTATION, annotationDoc);
AnnotationDesc.ElementValuePair[] pairs = descList[i].elementValues();
// If the annotation is synthesized, do not print the container.
if (descList[i].isSynthesized()) {
@@ -2081,7 +2081,7 @@
}
}
}
- annotation.append(getDocLink(LinkInfoImpl.CONTEXT_ANNOTATION,
+ annotation.append(getDocLink(LinkInfoImpl.Kind.ANNOTATION,
pairs[j].element(), pairs[j].element().name(), false));
annotation.append('=');
AnnotationValue annotationValue = pairs[j].value();
@@ -2143,7 +2143,7 @@
Type type = (Type) annotationValue.value();
if (type.asClassDoc() != null) {
LinkInfoImpl linkInfo = new LinkInfoImpl(configuration,
- LinkInfoImpl.CONTEXT_ANNOTATION, type);
+ LinkInfoImpl.Kind.ANNOTATION, type);
linkInfo.label = (type.asClassDoc().isIncluded() ?
type.typeName() :
type.qualifiedTypeName()) + type.dimension() + ".class";
@@ -2161,7 +2161,7 @@
}
return buf.toString();
} else if (annotationValue.value() instanceof MemberDoc) {
- return getDocLink(LinkInfoImpl.CONTEXT_ANNOTATION,
+ return getDocLink(LinkInfoImpl.Kind.ANNOTATION,
(MemberDoc) annotationValue.value(),
((MemberDoc) annotationValue.value()).name(), false);
} else {
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/HtmlSerialFieldWriter.java Fri May 10 15:15:50 2013 +0200
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/HtmlSerialFieldWriter.java Tue May 14 10:14:51 2013 -0700
@@ -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.
*
* This code is free software; you can redistribute it and/or modify it
@@ -130,7 +130,7 @@
pre.addContent(fieldTypeStr);
} else {
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(fieldDimensions + " ");
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/LinkFactoryImpl.java Fri May 10 15:15:50 2013 +0200
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/LinkFactoryImpl.java Tue May 14 10:14:51 2013 -0700
@@ -121,7 +121,7 @@
protected LinkOutput getTypeParameterLink(LinkInfo linkInfo,
Type typeParam) {
LinkInfoImpl typeLinkInfo = new LinkInfoImpl(m_writer.configuration,
- linkInfo.getContext(), typeParam);
+ ((LinkInfoImpl) linkInfo).getContext(), typeParam);
typeLinkInfo.excludeTypeBounds = linkInfo.excludeTypeBounds;
typeLinkInfo.excludeTypeParameterLinks = linkInfo.excludeTypeParameterLinks;
typeLinkInfo.linkToSelf = linkInfo.linkToSelf;
@@ -204,7 +204,7 @@
* @param linkInfo the information about the link.
*/
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
//with 1.4.2 output.
return DocPath.forName(linkInfo.classDoc);
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/LinkInfoImpl.java Fri May 10 15:15:50 2013 +0200
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/LinkInfoImpl.java Tue May 14 10:14:51 2013 -0700
@@ -38,177 +38,181 @@
*/
public class LinkInfoImpl extends LinkInfo {
- /**
- * Indicate that the link appears in a class list.
- */
- public static final int ALL_CLASSES_FRAME = 1;
+ public enum Kind {
+ DEFAULT,
- /**
- * Indicate that the link appears in a class documentation.
- */
- public static final int CONTEXT_CLASS = 2;
+ /**
+ * Indicate that the link appears in a class list.
+ */
+ ALL_CLASSES_FRAME,
- /**
- * Indicate that the link appears in member documentation.
- */
- public static final int CONTEXT_MEMBER = 3;
+ /**
+ * Indicate that the link appears in a class documentation.
+ */
+ CLASS,
- /**
- * Indicate that the link appears in class use documentation.
- */
- public static final int CONTEXT_CLASS_USE = 4;
+ /**
+ * Indicate that the link appears in member documentation.
+ */
+ MEMBER,
- /**
- * Indicate that the link appears in index documentation.
- */
- public static final int CONTEXT_INDEX = 5;
+ /**
+ * Indicate that the link appears in class use documentation.
+ */
+ CLASS_USE,
- /**
- * Indicate that the link appears in constant value summary.
- */
- public static final int CONTEXT_CONSTANT_SUMMARY = 6;
+ /**
+ * Indicate that the link appears in index documentation.
+ */
+ INDEX,
- /**
- * Indicate that the link appears in serialized form documentation.
- */
- public static final int CONTEXT_SERIALIZED_FORM = 7;
+ /**
+ * Indicate that the link appears in constant value summary.
+ */
+ CONSTANT_SUMMARY,
- /**
- * Indicate that the link appears in serial member documentation.
- */
- public static final int CONTEXT_SERIAL_MEMBER = 8;
+ /**
+ * Indicate that the link appears in serialized form documentation.
+ */
+ SERIALIZED_FORM,
- /**
- * Indicate that the link appears in package documentation.
- */
- public static final int CONTEXT_PACKAGE = 9;
+ /**
+ * Indicate that the link appears in serial member documentation.
+ */
+ SERIAL_MEMBER,
- /**
- * Indicate that the link appears in see tag documentation.
- */
- public static final int CONTEXT_SEE_TAG = 10;
+ /**
+ * Indicate that the link appears in package documentation.
+ */
+ PACKAGE,
- /**
- * Indicate that the link appears in value tag documentation.
- */
- public static final int CONTEXT_VALUE_TAG = 11;
+ /**
+ * Indicate that the link appears in see tag documentation.
+ */
+ SEE_TAG,
- /**
- * Indicate that the link appears in tree documentation.
- */
- public static final int CONTEXT_TREE = 12;
+ /**
+ * Indicate that the link appears in value tag documentation.
+ */
+ VALUE_TAG,
- /**
- * Indicate that the link appears in a class list.
- */
- public static final int PACKAGE_FRAME = 13;
+ /**
+ * Indicate that the link appears in tree documentation.
+ */
+ TREE,
- /**
- * The header in the class documentation.
- */
- public static final int CONTEXT_CLASS_HEADER = 14;
+ /**
+ * Indicate that the link appears in a class list.
+ */
+ PACKAGE_FRAME,
- /**
- * The signature in the class documentation.
- */
- public static final int CONTEXT_CLASS_SIGNATURE = 15;
+ /**
+ * The header in the class documentation.
+ */
+ CLASS_HEADER,
- /**
- * The return type of a method.
- */
- public static final int CONTEXT_RETURN_TYPE = 16;
+ /**
+ * The signature in the class documentation.
+ */
+ CLASS_SIGNATURE,
+
+ /**
+ * The return type of a method.
+ */
+ RETURN_TYPE,
- /**
- * The return type of a method in a member summary.
- */
- public static final int CONTEXT_SUMMARY_RETURN_TYPE = 17;
+ /**
+ * The return type of a method in a member summary.
+ */
+ SUMMARY_RETURN_TYPE,
- /**
- * The type of a method/constructor parameter.
- */
- public static final int CONTEXT_EXECUTABLE_MEMBER_PARAM = 18;
+ /**
+ * The type of a method/constructor parameter.
+ */
+ EXECUTABLE_MEMBER_PARAM,
- /**
- * Super interface links.
- */
- public static final int CONTEXT_SUPER_INTERFACES = 19;
+ /**
+ * Super interface links.
+ */
+ SUPER_INTERFACES,
- /**
- * Implemented interface links.
- */
- public static final int CONTEXT_IMPLEMENTED_INTERFACES = 20;
+ /**
+ * Implemented interface links.
+ */
+ IMPLEMENTED_INTERFACES,
- /**
- * Implemented class links.
- */
- public static final int CONTEXT_IMPLEMENTED_CLASSES = 21;
+ /**
+ * Implemented class links.
+ */
+ IMPLEMENTED_CLASSES,
- /**
- * Subinterface links.
- */
- public static final int CONTEXT_SUBINTERFACES = 22;
+ /**
+ * Subinterface links.
+ */
+ SUBINTERFACES,
- /**
- * Subclasses links.
- */
- public static final int CONTEXT_SUBCLASSES = 23;
+ /**
+ * Subclasses links.
+ */
+ SUBCLASSES,
- /**
- * The signature in the class documentation (implements/extends portion).
- */
- public static final int CONTEXT_CLASS_SIGNATURE_PARENT_NAME = 24;
+ /**
+ * The signature in the class documentation (implements/extends portion).
+ */
+ CLASS_SIGNATURE_PARENT_NAME,
- /**
- * The header for method documentation copied from parent.
- */
- public static final int CONTEXT_METHOD_DOC_COPY = 26;
+ /**
+ * The header for method documentation copied from parent.
+ */
+ METHOD_DOC_COPY,
- /**
- * Method "specified by" link.
- */
- public static final int CONTEXT_METHOD_SPECIFIED_BY = 27;
+ /**
+ * Method "specified by" link.
+ */
+ METHOD_SPECIFIED_BY,
- /**
- * Method "overrides" link.
- */
- public static final int CONTEXT_METHOD_OVERRIDES = 28;
+ /**
+ * Method "overrides" link.
+ */
+ METHOD_OVERRIDES,
- /**
- * Annotation link.
- */
- public static final int CONTEXT_ANNOTATION = 29;
+ /**
+ * Annotation link.
+ */
+ ANNOTATION,
- /**
- * The header for field documentation copied from parent.
- */
- public static final int CONTEXT_FIELD_DOC_COPY = 30;
+ /**
+ * The header for field documentation copied from parent.
+ */
+ FIELD_DOC_COPY,
- /**
- * The parent nodes int the class tree.
- */
- public static final int CONTEXT_CLASS_TREE_PARENT = 31;
+ /**
+ * The parent nodes in the class tree.
+ */
+ CLASS_TREE_PARENT,
- /**
- * The type parameters of a method or constructor.
- */
- public static final int CONTEXT_MEMBER_TYPE_PARAMS = 32;
+ /**
+ * The type parameters of a method or constructor.
+ */
+ MEMBER_TYPE_PARAMS,
- /**
- * Indicate that the link appears in class use documentation.
- */
- public static final int CONTEXT_CLASS_USE_HEADER = 33;
+ /**
+ * Indicate that the link appears in class use documentation.
+ */
+ CLASS_USE_HEADER,
- /**
- * The header for property documentation copied from parent.
- */
- public static final int CONTEXT_PROPERTY_DOC_COPY = 34;
+ /**
+ * The header for property documentation copied from parent.
+ */
+ PROPERTY_DOC_COPY
+ }
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 #.
@@ -235,7 +239,7 @@
* @param target the value of the target attribute.
*/
public LinkInfoImpl(ConfigurationImpl configuration,
- int context, ClassDoc classDoc, String label, String target) {
+ Kind context, ClassDoc classDoc, String label, String target) {
this.configuration = configuration;
this.classDoc = classDoc;
this.label = label;
@@ -255,7 +259,7 @@
* @param styleName String style of text defined in style sheet.
*/
public LinkInfoImpl(ConfigurationImpl configuration,
- int context, ClassDoc classDoc, String where, String label,
+ Kind context, ClassDoc classDoc, String where, String label,
boolean isStrong, String styleName) {
this.configuration = configuration;
this.classDoc = classDoc;
@@ -277,7 +281,7 @@
* @param isStrong true if the link should be strong.
*/
public LinkInfoImpl(ConfigurationImpl configuration,
- int context, ClassDoc classDoc, String where, String label,
+ Kind context, ClassDoc classDoc, String where, String label,
boolean isStrong) {
this.configuration = configuration;
this.classDoc = classDoc;
@@ -311,7 +315,7 @@
* @param isStrong true if the link should be strong.
*/
public LinkInfoImpl(ConfigurationImpl configuration,
- int context, ExecutableMemberDoc executableMemberDoc,
+ Kind context, ExecutableMemberDoc executableMemberDoc,
boolean isStrong) {
this.configuration = configuration;
this.executableMemberDoc = executableMemberDoc;
@@ -328,7 +332,7 @@
* @param isStrong true if the link should be strong.
*/
public LinkInfoImpl(ConfigurationImpl configuration,
- int context, ClassDoc classDoc, boolean isStrong) {
+ Kind context, ClassDoc classDoc, boolean isStrong) {
this.configuration = configuration;
this.classDoc = classDoc;
this.isStrong = isStrong;
@@ -343,7 +347,7 @@
* @param type the class to link to.
*/
public LinkInfoImpl(ConfigurationImpl configuration,
- int context, Type type) {
+ Kind context, Type type) {
this.configuration = configuration;
this.type = type;
setContext(context);
@@ -358,7 +362,7 @@
* @param isVarArg true if this is a link to a var arg.
*/
public LinkInfoImpl(ConfigurationImpl configuration,
- int context, Type type, boolean isVarArg) {
+ Kind context, Type type, boolean isVarArg) {
this.configuration = configuration;
this.type = type;
this.isVarArg = isVarArg;
@@ -375,7 +379,7 @@
* @param isStrong true if the link should be strong.
*/
public LinkInfoImpl(ConfigurationImpl configuration,
- int context, Type type, String label,
+ Kind context, Type type, String label,
boolean isStrong) {
this.configuration = configuration;
this.type = type;
@@ -394,7 +398,7 @@
* @param isStrong true if the link should be strong.
*/
public LinkInfoImpl(ConfigurationImpl configuration,
- int context, ClassDoc classDoc, String label,
+ Kind context, ClassDoc classDoc, String label,
boolean isStrong) {
this.configuration = configuration;
this.classDoc = classDoc;
@@ -406,7 +410,7 @@
/**
* {@inheritDoc}
*/
- public int getContext() {
+ public Kind getContext() {
return context;
}
@@ -418,56 +422,56 @@
*
* @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.
switch (c) {
case ALL_CLASSES_FRAME:
case PACKAGE_FRAME:
- case CONTEXT_IMPLEMENTED_CLASSES:
- case CONTEXT_SUBCLASSES:
- case CONTEXT_METHOD_DOC_COPY:
- case CONTEXT_FIELD_DOC_COPY:
- case CONTEXT_PROPERTY_DOC_COPY:
- case CONTEXT_CLASS_USE_HEADER:
+ case IMPLEMENTED_CLASSES:
+ case SUBCLASSES:
+ case METHOD_DOC_COPY:
+ case FIELD_DOC_COPY:
+ case PROPERTY_DOC_COPY:
+ case CLASS_USE_HEADER:
includeTypeInClassLinkLabel = false;
break;
- case CONTEXT_ANNOTATION:
+ case ANNOTATION:
excludeTypeParameterLinks = true;
excludeTypeBounds = true;
break;
- case CONTEXT_IMPLEMENTED_INTERFACES:
- case CONTEXT_SUPER_INTERFACES:
- case CONTEXT_SUBINTERFACES:
- case CONTEXT_CLASS_TREE_PARENT:
- case CONTEXT_TREE:
- case CONTEXT_CLASS_SIGNATURE_PARENT_NAME:
+ case IMPLEMENTED_INTERFACES:
+ case SUPER_INTERFACES:
+ case SUBINTERFACES:
+ case CLASS_TREE_PARENT:
+ case TREE:
+ case CLASS_SIGNATURE_PARENT_NAME:
excludeTypeParameterLinks = true;
excludeTypeBounds = true;
includeTypeInClassLinkLabel = false;
includeTypeAsSepLink = true;
break;
- case CONTEXT_PACKAGE:
- case CONTEXT_CLASS_USE:
- case CONTEXT_CLASS_HEADER:
- case CONTEXT_CLASS_SIGNATURE:
+ case PACKAGE:
+ case CLASS_USE:
+ case CLASS_HEADER:
+ case CLASS_SIGNATURE:
excludeTypeParameterLinks = true;
includeTypeAsSepLink = true;
includeTypeInClassLinkLabel = false;
break;
- case CONTEXT_MEMBER_TYPE_PARAMS:
+ case MEMBER_TYPE_PARAMS:
includeTypeAsSepLink = true;
includeTypeInClassLinkLabel = false;
break;
- case CONTEXT_RETURN_TYPE:
- case CONTEXT_SUMMARY_RETURN_TYPE:
+ case RETURN_TYPE:
+ case SUMMARY_RETURN_TYPE:
excludeTypeBounds = true;
break;
- case CONTEXT_EXECUTABLE_MEMBER_PARAM:
+ case EXECUTABLE_MEMBER_PARAM:
excludeTypeBounds = true;
break;
}
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/MethodWriterImpl.java Fri May 10 15:15:50 2013 +0200
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/MethodWriterImpl.java Tue May 14 10:14:51 2013 -0700
@@ -153,7 +153,7 @@
writer.addInlineComment(method, methodDocTree);
} else {
Content link = new RawHtml(
- writer.getDocLink(LinkInfoImpl.CONTEXT_METHOD_DOC_COPY,
+ writer.getDocLink(LinkInfoImpl.Kind.METHOD_DOC_COPY,
holder.asClassDoc(), method,
holder.asClassDoc().isIncluded() ?
holder.typeName() : holder.qualifiedTypeName(),
@@ -261,7 +261,7 @@
*/
public void addInheritedSummaryLabel(ClassDoc cd, Content inheritedTree) {
Content classLink = new RawHtml(writer.getPreQualifiedClassLink(
- LinkInfoImpl.CONTEXT_MEMBER, cd, false));
+ LinkInfoImpl.Kind.MEMBER, cd, false));
Content label = new StringContent(cd.isClass() ?
configuration.getText("doclet.Methods_Inherited_From_Class") :
configuration.getText("doclet.Methods_Inherited_From_Interface"));
@@ -300,14 +300,14 @@
return;
}
Content label = writer.overridesLabel;
- int context = LinkInfoImpl.CONTEXT_METHOD_OVERRIDES;
+ LinkInfoImpl.Kind context = LinkInfoImpl.Kind.METHOD_OVERRIDES;
if (method != null) {
if (overriddenType.asClassDoc().isAbstract() && method.isAbstract()){
//Abstract method is implemented from abstract class,
//not overridden
label = writer.specifiedByLabel;
- context = LinkInfoImpl.CONTEXT_METHOD_SPECIFIED_BY;
+ context = LinkInfoImpl.Kind.METHOD_SPECIFIED_BY;
}
Content dt = HtmlTree.DT(HtmlTree.STRONG(label));
dl.addContent(dt);
@@ -316,7 +316,7 @@
Content codeOverridenTypeLink = HtmlTree.CODE(overriddenTypeLink);
String name = method.name();
Content methlink = new RawHtml(writer.getLink(
- new LinkInfoImpl(writer.configuration, LinkInfoImpl.CONTEXT_MEMBER,
+ new LinkInfoImpl(writer.configuration, LinkInfoImpl.Kind.MEMBER,
overriddenType.asClassDoc(),
writer.getAnchor(method), name, false)));
Content codeMethLink = HtmlTree.CODE(methlink);
@@ -362,12 +362,12 @@
MethodDoc implementedMeth = implementedMethods[i];
Type intfac = implementedMethodsFinder.getMethodHolder(implementedMeth);
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 dt = HtmlTree.DT(HtmlTree.STRONG(writer.specifiedByLabel));
dl.addContent(dt);
Content methlink = new RawHtml(writer.getDocLink(
- LinkInfoImpl.CONTEXT_MEMBER, implementedMeth,
+ LinkInfoImpl.Kind.MEMBER, implementedMeth,
implementedMeth.name(), false));
Content codeMethLink = HtmlTree.CODE(methlink);
Content dd = HtmlTree.DD(codeMethLink);
@@ -389,7 +389,7 @@
Type type = method.returnType();
if (type != null) {
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(writer.getSpace());
}
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/NestedClassWriterImpl.java Fri May 10 15:15:50 2013 +0200
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/NestedClassWriterImpl.java Tue May 14 10:14:51 2013 -0700
@@ -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.
*
* This code is free software; you can redistribute it and/or modify it
@@ -149,7 +149,7 @@
*/
public void addInheritedSummaryLabel(ClassDoc cd, Content inheritedTree) {
Content classLink = new RawHtml(writer.getPreQualifiedClassLink(
- LinkInfoImpl.CONTEXT_MEMBER, cd, false));
+ LinkInfoImpl.Kind.MEMBER, cd, false));
Content label = new StringContent(cd.isInterface() ?
configuration.getText("doclet.Nested_Classes_Interface_Inherited_From_Interface") :
configuration.getText("doclet.Nested_Classes_Interfaces_Inherited_From_Class"));
@@ -163,7 +163,7 @@
/**
* {@inheritDoc}
*/
- protected void addSummaryLink(int context, ClassDoc cd, ProgramElementDoc member,
+ protected void addSummaryLink(LinkInfoImpl.Kind context, ClassDoc cd, ProgramElementDoc member,
Content tdSummary) {
Content strong = HtmlTree.STRONG(new RawHtml(
writer.getLink(new LinkInfoImpl(configuration, context, (ClassDoc)member, false))));
@@ -177,7 +177,7 @@
protected void addInheritedSummaryLink(ClassDoc cd,
ProgramElementDoc member, Content linksTree) {
linksTree.addContent(new RawHtml(
- writer.getLink(new LinkInfoImpl(configuration, LinkInfoImpl.CONTEXT_MEMBER,
+ writer.getLink(new LinkInfoImpl(configuration, LinkInfoImpl.Kind.MEMBER,
(ClassDoc)member, false))));
}
@@ -194,7 +194,7 @@
* {@inheritDoc}
*/
protected Content getDeprecatedLink(ProgramElementDoc member) {
- return writer.getQualifiedClassLink(LinkInfoImpl.CONTEXT_MEMBER,
+ return writer.getQualifiedClassLink(LinkInfoImpl.Kind.MEMBER,
(ClassDoc)member);
}
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/PackageFrameWriter.java Fri May 10 15:15:50 2013 +0200
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/PackageFrameWriter.java Tue May 14 10:14:51 2013 -0700
@@ -183,7 +183,7 @@
printedHeader = true;
}
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].name()),"classFrame")));
Content li = HtmlTree.LI(link);
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/PackageWriterImpl.java Fri May 10 15:15:50 2013 +0200
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/PackageWriterImpl.java Tue May 14 10:14:51 2013 -0700
@@ -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.
*
* This code is free software; you can redistribute it and/or modify it
@@ -179,7 +179,7 @@
continue;
}
Content classContent = new RawHtml(getLink(new LinkInfoImpl(
- configuration, LinkInfoImpl.CONTEXT_PACKAGE, classes[i],
+ configuration, LinkInfoImpl.Kind.PACKAGE, classes[i],
false)));
Content tdClass = HtmlTree.TD(HtmlStyle.colFirst, classContent);
HtmlTree tr = HtmlTree.TR(tdClass);
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/ProfilePackageFrameWriter.java Fri May 10 15:15:50 2013 +0200
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/ProfilePackageFrameWriter.java Tue May 14 10:14:51 2013 -0700
@@ -174,7 +174,7 @@
printedHeader = true;
}
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].name()),"classFrame")));
Content li = HtmlTree.LI(link);
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/PropertyWriterImpl.java Fri May 10 15:15:50 2013 +0200
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/PropertyWriterImpl.java Tue May 14 10:14:51 2013 -0700
@@ -99,7 +99,7 @@
writer.addAnnotationInfo(property, pre);
addModifiers(property, pre);
Content propertylink = new RawHtml(writer.getLink(new LinkInfoImpl(
- configuration, LinkInfoImpl.CONTEXT_MEMBER,
+ configuration, LinkInfoImpl.Kind.MEMBER,
property.returnType())));
pre.addContent(propertylink);
pre.addContent(" ");
@@ -129,7 +129,7 @@
writer.addInlineComment(property, propertyDocTree);
} else {
Content link = new RawHtml(
- writer.getDocLink(LinkInfoImpl.CONTEXT_PROPERTY_DOC_COPY,
+ writer.getDocLink(LinkInfoImpl.Kind.PROPERTY_DOC_COPY,
holder, property,
holder.isIncluded() ?
holder.typeName() : holder.qualifiedTypeName(),
@@ -236,7 +236,7 @@
*/
public void addInheritedSummaryLabel(ClassDoc cd, Content inheritedTree) {
Content classLink = new RawHtml(writer.getPreQualifiedClassLink(
- LinkInfoImpl.CONTEXT_MEMBER, cd, false));
+ LinkInfoImpl.Kind.MEMBER, cd, false));
Content label = new StringContent(cd.isClass() ?
configuration.getText("doclet.Properties_Inherited_From_Class") :
configuration.getText("doclet.Properties_Inherited_From_Interface"));
@@ -250,7 +250,7 @@
/**
* {@inheritDoc}
*/
- protected void addSummaryLink(int context, ClassDoc cd, ProgramElementDoc member,
+ protected void addSummaryLink(LinkInfoImpl.Kind context, ClassDoc cd, ProgramElementDoc member,
Content tdSummary) {
Content strong = HtmlTree.STRONG(new RawHtml(
writer.getDocLink(context,
@@ -270,7 +270,7 @@
protected void addInheritedSummaryLink(ClassDoc cd,
ProgramElementDoc member, Content linksTree) {
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().substring(0, member.name().length() - "Property".length())
: member.name(),
@@ -289,7 +289,7 @@
* {@inheritDoc}
*/
protected Content getDeprecatedLink(ProgramElementDoc member) {
- return writer.getDocLink(LinkInfoImpl.CONTEXT_MEMBER,
+ return writer.getDocLink(LinkInfoImpl.Kind.MEMBER,
(MemberDoc) member, ((MethodDoc)member).qualifiedName());
}
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/SerializedFormWriterImpl.java Fri May 10 15:15:50 2013 +0200
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/SerializedFormWriterImpl.java Tue May 14 10:14:51 2013 -0700
@@ -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.
*
* This code is free software; you can redistribute it and/or modify it
@@ -136,7 +136,7 @@
String superClassLink =
classDoc.superclassType() != null ?
getLink(new LinkInfoImpl(configuration,
- LinkInfoImpl.CONTEXT_SERIALIZED_FORM,
+ LinkInfoImpl.Kind.SERIALIZED_FORM,
classDoc.superclassType())) :
null;
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/TagletWriterImpl.java Fri May 10 15:15:50 2013 +0200
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/TagletWriterImpl.java Tue May 14 10:14:51 2013 -0700
@@ -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.
*
* This code is free software; you can redistribute it and/or modify it
@@ -247,7 +247,7 @@
result += throwsTag.exceptionType() == null ?
htmlWriter.codeText(throwsTag.exceptionName()) :
htmlWriter.codeText(
- htmlWriter.getLink(new LinkInfoImpl(configuration, LinkInfoImpl.CONTEXT_MEMBER,
+ htmlWriter.getLink(new LinkInfoImpl(configuration, LinkInfoImpl.Kind.MEMBER,
throwsTag.exceptionType())));
TagletOutput text = new TagletOutputImpl(
htmlWriter.commentTagsToString(throwsTag, null,
@@ -265,7 +265,7 @@
public TagletOutput throwsTagOutput(Type throwsType) {
return new TagletOutputImpl(DocletConstants.NL + "<dd>" +
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 TagletOutput valueTagOutput(FieldDoc field, String constantVal,
boolean includeLink) {
return new TagletOutputImpl(includeLink ?
- htmlWriter.getDocLink(LinkInfoImpl.CONTEXT_VALUE_TAG, field,
+ htmlWriter.getDocLink(LinkInfoImpl.Kind.VALUE_TAG, field,
constantVal, false) : constantVal);
}
--- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/links/LinkInfo.java Fri May 10 15:15:50 2013 +0200
+++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/links/LinkInfo.java Tue May 14 10:14:51 2013 -0700
@@ -121,21 +121,6 @@
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
* desired place.
*