提交 cc56c8b6 编写于 作者: J jjg

8010440: Replace int constants in LinkInfoImpl with enum

Reviewed-by: bpatel, darcy
上级 8b5d6838
......@@ -62,7 +62,7 @@ public abstract class AbstractExecutableMemberWriter extends AbstractMemberWrite
*/
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 @@ public abstract class AbstractExecutableMemberWriter extends AbstractMemberWrite
*/
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 @@ public abstract class AbstractExecutableMemberWriter extends AbstractMemberWrite
* @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 @@ public abstract class AbstractExecutableMemberWriter extends AbstractMemberWrite
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 @@ public abstract class AbstractExecutableMemberWriter extends AbstractMemberWrite
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 @@ public abstract class AbstractExecutableMemberWriter extends AbstractMemberWrite
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 @@ public abstract class AbstractExecutableMemberWriter extends AbstractMemberWrite
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 @@ public abstract class AbstractExecutableMemberWriter extends AbstractMemberWrite
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 @@ public abstract class AbstractExecutableMemberWriter extends AbstractMemberWrite
rettype.dimension().length();
} else {
LinkInfoImpl linkInfo = new LinkInfoImpl(configuration,
LinkInfoImpl.CONTEXT_MEMBER, rettype);
LinkInfoImpl.Kind.MEMBER, rettype);
writer.getLink(linkInfo);
return linkInfo.displayLength;
}
......
/*
* 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 @@ public class AbstractIndexWriter extends HtmlDocletWriter {
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 @@ 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.
*
* @param cd the class being documented
......@@ -179,7 +179,7 @@ public class AbstractIndexWriter extends HtmlDocletWriter {
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 @@ public class AbstractIndexWriter extends HtmlDocletWriter {
getResource("doclet.Method_in", classdesc));
}
}
addPreQualifiedClassLink(LinkInfoImpl.CONTEXT_INDEX, containing,
addPreQualifiedClassLink(LinkInfoImpl.Kind.INDEX, containing,
false, contentTree);
}
}
/*
* 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 @@ public abstract class AbstractMemberWriter {
*/
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 @@ public abstract class AbstractMemberWriter {
* @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 @@ public abstract class AbstractMemberWriter {
}
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 @@ public abstract class AbstractMemberWriter {
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);
......
/*
* 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 @@ public abstract class AbstractTreeWriter extends HtmlDocletWriter {
} else {
contentTree.addContent(", ");
}
addPreQualifiedClassLink(LinkInfoImpl.CONTEXT_TREE,
addPreQualifiedClassLink(LinkInfoImpl.Kind.TREE,
interfaces[i], contentTree);
counter++;
}
......@@ -170,7 +170,7 @@ public abstract class AbstractTreeWriter extends HtmlDocletWriter {
* @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);
}
/**
......
/*
* 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 @@ public class AllClassesFrameWriter extends HtmlDocletWriter {
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)));
......
/*
* 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 @@ public class AnnotationTypeRequiredMemberWriterImpl extends AbstractMemberWriter
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 @@ public class AnnotationTypeRequiredMemberWriterImpl extends AbstractMemberWriter
/**
* {@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 @@ public class AnnotationTypeRequiredMemberWriterImpl extends AbstractMemberWriter
* {@inheritDoc}
*/
protected Content getDeprecatedLink(ProgramElementDoc member) {
return writer.getDocLink(LinkInfoImpl.CONTEXT_MEMBER,
return writer.getDocLink(LinkInfoImpl.Kind.MEMBER,
(MemberDoc) member, ((MemberDoc)member).qualifiedName());
}
......
/*
* 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 @@ public class AnnotationTypeWriterImpl extends SubWriterHolderWriter
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 @@ public class AnnotationTypeWriterImpl extends SubWriterHolderWriter
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 @@ public class AnnotationTypeWriterImpl extends SubWriterHolderWriter
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 @@ public class AnnotationTypeWriterImpl extends SubWriterHolderWriter
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) {
......
/*
* 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 @@ public class ClassUseWriter extends SubWriterHolderWriter {
Content table = HtmlTree.TABLE(0, 3, 0, useTableSummary,
getTableCaption(configuration.getText(
"doclet.ClassUse_Packages.that.use.0",
getLink(new LinkInfoImpl(configuration, LinkInfoImpl.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 @@ public class ClassUseWriter extends SubWriterHolderWriter {
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 @@ public class ClassUseWriter extends SubWriterHolderWriter {
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 @@ public class ClassUseWriter extends SubWriterHolderWriter {
*/
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 @@ public class ClassUseWriter extends SubWriterHolderWriter {
*/
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;
......
......@@ -125,7 +125,7 @@ public class ClassWriterImpl extends SubWriterHolderWriter
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 @@ public class ClassWriterImpl extends SubWriterHolderWriter
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 @@ public class ClassWriterImpl extends SubWriterHolderWriter
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 @@ public class ClassWriterImpl extends SubWriterHolderWriter
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 @@ public class ClassWriterImpl extends SubWriterHolderWriter
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 @@ public class ClassWriterImpl extends SubWriterHolderWriter
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 @@ public class ClassWriterImpl extends SubWriterHolderWriter
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 @@ public class ClassWriterImpl extends SubWriterHolderWriter
}
} 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 @@ public class ClassWriterImpl extends SubWriterHolderWriter
"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 @@ public class ClassWriterImpl extends SubWriterHolderWriter
"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 @@ public class ClassWriterImpl extends SubWriterHolderWriter
"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 @@ public class ClassWriterImpl extends SubWriterHolderWriter
"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 @@ public class ClassWriterImpl extends SubWriterHolderWriter
"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 @@ public class ClassWriterImpl extends SubWriterHolderWriter
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 @@ public class ClassWriterImpl extends SubWriterHolderWriter
* @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++) {
......
/*
* 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 @@ public class ConstantsSummaryWriterImpl extends HtmlDocletWriter
//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 @@ public class ConstantsSummaryWriterImpl extends HtmlDocletWriter
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 @@ public class ConstantsSummaryWriterImpl extends HtmlDocletWriter
*/
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);
}
......
/*
* 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 @@ public class EnumConstantWriterImpl extends AbstractMemberWriter
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 @@ public class EnumConstantWriterImpl extends AbstractMemberWriter
/**
* {@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 @@ public class EnumConstantWriterImpl extends AbstractMemberWriter
* {@inheritDoc}
*/
protected Content getDeprecatedLink(ProgramElementDoc member) {
return writer.getDocLink(LinkInfoImpl.CONTEXT_MEMBER,
return writer.getDocLink(LinkInfoImpl.Kind.MEMBER,
(MemberDoc) member, ((FieldDoc)member).qualifiedName());
}
......
/*
* 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 @@ public class FieldWriterImpl extends AbstractMemberWriter
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 @@ public class FieldWriterImpl extends AbstractMemberWriter
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 class FieldWriterImpl extends AbstractMemberWriter
*/
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 @@ public class FieldWriterImpl extends AbstractMemberWriter
/**
* {@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 @@ public class FieldWriterImpl extends AbstractMemberWriter
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 @@ public class FieldWriterImpl extends AbstractMemberWriter
* {@inheritDoc}
*/
protected Content getDeprecatedLink(ProgramElementDoc member) {
return writer.getDocLink(LinkInfoImpl.CONTEXT_MEMBER,
return writer.getDocLink(LinkInfoImpl.Kind.MEMBER,
(MemberDoc) member, ((FieldDoc)member).qualifiedName());
}
......
......@@ -373,7 +373,7 @@ public class HtmlDocletWriter extends HtmlDocWriter {
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 @@ public class HtmlDocletWriter extends HtmlDocWriter {
* @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 @@ public class HtmlDocletWriter extends HtmlDocWriter {
* @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 @@ public class HtmlDocletWriter extends HtmlDocWriter {
* @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 @@ public class HtmlDocletWriter extends HtmlDocWriter {
* @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 @@ public class HtmlDocletWriter extends HtmlDocWriter {
* @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 @@ public class HtmlDocletWriter extends HtmlDocWriter {
* @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 @@ public class HtmlDocletWriter extends HtmlDocWriter {
* @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 @@ public class HtmlDocletWriter extends HtmlDocWriter {
* @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 @@ public class HtmlDocletWriter extends HtmlDocWriter {
* @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 @@ public class HtmlDocletWriter extends HtmlDocWriter {
* @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 @@ public class HtmlDocletWriter extends HtmlDocWriter {
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 @@ public class HtmlDocletWriter extends HtmlDocWriter {
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 @@ 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));
annotation.append('=');
AnnotationValue annotationValue = pairs[j].value();
......@@ -2143,7 +2143,7 @@ public class HtmlDocletWriter extends HtmlDocWriter {
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 @@ public class HtmlDocletWriter extends HtmlDocWriter {
}
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 {
......
/*
* 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 @@ public class HtmlSerialFieldWriter extends FieldWriterImpl
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 + " ");
......
......@@ -121,7 +121,7 @@ public class LinkFactoryImpl extends LinkFactory {
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 @@ public class LinkFactoryImpl extends LinkFactory {
* @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);
......
......@@ -38,177 +38,181 @@ import com.sun.tools.doclets.internal.toolkit.util.links.*;
*/
public class LinkInfoImpl extends LinkInfo {
public enum Kind {
DEFAULT,
/**
* 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.
*/
public static final int CONTEXT_CLASS = 2;
CLASS,
/**
* 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.
*/
public static final int CONTEXT_CLASS_USE = 4;
CLASS_USE,
/**
* 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.
*/
public static final int CONTEXT_CONSTANT_SUMMARY = 6;
CONSTANT_SUMMARY,
/**
* 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.
*/
public static final int CONTEXT_SERIAL_MEMBER = 8;
SERIAL_MEMBER,
/**
* 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.
*/
public static final int CONTEXT_SEE_TAG = 10;
SEE_TAG,
/**
* 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.
*/
public static final int CONTEXT_TREE = 12;
TREE,
/**
* Indicate that the link appears in a class list.
*/
public static final int PACKAGE_FRAME = 13;
PACKAGE_FRAME,
/**
* The header in the class documentation.
*/
public static final int CONTEXT_CLASS_HEADER = 14;
CLASS_HEADER,
/**
* The signature in the class documentation.
*/
public static final int CONTEXT_CLASS_SIGNATURE = 15;
CLASS_SIGNATURE,
/**
* 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.
*/
public static final int CONTEXT_SUMMARY_RETURN_TYPE = 17;
SUMMARY_RETURN_TYPE,
/**
* The type of a method/constructor parameter.
*/
public static final int CONTEXT_EXECUTABLE_MEMBER_PARAM = 18;
EXECUTABLE_MEMBER_PARAM,
/**
* Super interface links.
*/
public static final int CONTEXT_SUPER_INTERFACES = 19;
SUPER_INTERFACES,
/**
* Implemented interface links.
*/
public static final int CONTEXT_IMPLEMENTED_INTERFACES = 20;
IMPLEMENTED_INTERFACES,
/**
* Implemented class links.
*/
public static final int CONTEXT_IMPLEMENTED_CLASSES = 21;
IMPLEMENTED_CLASSES,
/**
* Subinterface links.
*/
public static final int CONTEXT_SUBINTERFACES = 22;
SUBINTERFACES,
/**
* Subclasses links.
*/
public static final int CONTEXT_SUBCLASSES = 23;
SUBCLASSES,
/**
* 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.
*/
public static final int CONTEXT_METHOD_DOC_COPY = 26;
METHOD_DOC_COPY,
/**
* Method "specified by" link.
*/
public static final int CONTEXT_METHOD_SPECIFIED_BY = 27;
METHOD_SPECIFIED_BY,
/**
* Method "overrides" link.
*/
public static final int CONTEXT_METHOD_OVERRIDES = 28;
METHOD_OVERRIDES,
/**
* Annotation link.
*/
public static final int CONTEXT_ANNOTATION = 29;
ANNOTATION,
/**
* 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.
*/
public static final int CONTEXT_MEMBER_TYPE_PARAMS = 32;
MEMBER_TYPE_PARAMS,
/**
* 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.
*/
public static final int CONTEXT_PROPERTY_DOC_COPY = 34;
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 @@ public class LinkInfoImpl extends LinkInfo {
* @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 @@ public class LinkInfoImpl extends LinkInfo {
* @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 @@ public class LinkInfoImpl extends LinkInfo {
* @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 @@ public class LinkInfoImpl extends LinkInfo {
* @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 @@ public class LinkInfoImpl extends LinkInfo {
* @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 @@ public class LinkInfoImpl extends LinkInfo {
* @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 @@ public class LinkInfoImpl extends LinkInfo {
* @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 @@ public class LinkInfoImpl extends LinkInfo {
* @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 @@ public class LinkInfoImpl extends LinkInfo {
* @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 @@ public class LinkInfoImpl extends LinkInfo {
/**
* {@inheritDoc}
*/
public int getContext() {
public Kind getContext() {
return context;
}
......@@ -418,56 +422,56 @@ public class LinkInfoImpl extends LinkInfo {
*
* @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;
}
......
......@@ -153,7 +153,7 @@ public class MethodWriterImpl extends AbstractExecutableMemberWriter
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 class MethodWriterImpl extends AbstractExecutableMemberWriter
*/
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 @@ public class MethodWriterImpl extends AbstractExecutableMemberWriter
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 @@ public class MethodWriterImpl extends AbstractExecutableMemberWriter
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 @@ public class MethodWriterImpl extends AbstractExecutableMemberWriter
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 @@ public class MethodWriterImpl extends AbstractExecutableMemberWriter
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());
}
......
/*
* 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 class NestedClassWriterImpl extends AbstractMemberWriter
*/
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 @@ public class NestedClassWriterImpl extends AbstractMemberWriter
/**
* {@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 @@ public class NestedClassWriterImpl extends AbstractMemberWriter
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 @@ public class NestedClassWriterImpl extends AbstractMemberWriter
* {@inheritDoc}
*/
protected Content getDeprecatedLink(ProgramElementDoc member) {
return writer.getQualifiedClassLink(LinkInfoImpl.CONTEXT_MEMBER,
return writer.getQualifiedClassLink(LinkInfoImpl.Kind.MEMBER,
(ClassDoc)member);
}
......
......@@ -183,7 +183,7 @@ public class PackageFrameWriter extends HtmlDocletWriter {
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);
......
/*
* 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 @@ public class PackageWriterImpl extends HtmlDocletWriter
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);
......
......@@ -174,7 +174,7 @@ public class ProfilePackageFrameWriter extends HtmlDocletWriter {
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);
......
......@@ -99,7 +99,7 @@ public class PropertyWriterImpl extends AbstractMemberWriter
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 @@ public class PropertyWriterImpl extends AbstractMemberWriter
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 class PropertyWriterImpl extends AbstractMemberWriter
*/
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 @@ public class PropertyWriterImpl extends AbstractMemberWriter
/**
* {@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 @@ public class PropertyWriterImpl extends AbstractMemberWriter
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 @@ public class PropertyWriterImpl extends AbstractMemberWriter
* {@inheritDoc}
*/
protected Content getDeprecatedLink(ProgramElementDoc member) {
return writer.getDocLink(LinkInfoImpl.CONTEXT_MEMBER,
return writer.getDocLink(LinkInfoImpl.Kind.MEMBER,
(MemberDoc) member, ((MethodDoc)member).qualifiedName());
}
......
/*
* 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 @@ public class SerializedFormWriterImpl extends SubWriterHolderWriter
String superClassLink =
classDoc.superclassType() != null ?
getLink(new LinkInfoImpl(configuration,
LinkInfoImpl.CONTEXT_SERIALIZED_FORM,
LinkInfoImpl.Kind.SERIALIZED_FORM,
classDoc.superclassType())) :
null;
......
/*
* 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 @@ public class TagletWriterImpl extends TagletWriter {
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 class TagletWriterImpl extends TagletWriter {
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 class TagletWriterImpl extends TagletWriter {
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);
}
......
......@@ -120,21 +120,6 @@ public abstract class LinkInfo {
*/
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.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册