1.1 --- a/src/share/classes/com/sun/tools/doclets/formats/html/ClassWriterImpl.java Wed Nov 14 17:23:10 2012 -0800 1.2 +++ b/src/share/classes/com/sun/tools/doclets/formats/html/ClassWriterImpl.java Thu Nov 15 09:18:36 2012 -0800 1.3 @@ -34,6 +34,7 @@ 1.4 import com.sun.tools.doclets.internal.toolkit.builders.*; 1.5 import com.sun.tools.doclets.internal.toolkit.taglets.*; 1.6 import com.sun.tools.doclets.internal.toolkit.util.*; 1.7 +import java.io.IOException; 1.8 1.9 /** 1.10 * Generate the Class Information Page. 1.11 @@ -56,24 +57,25 @@ 1.12 public class ClassWriterImpl extends SubWriterHolderWriter 1.13 implements ClassWriter { 1.14 1.15 - protected ClassDoc classDoc; 1.16 + protected final ClassDoc classDoc; 1.17 1.18 - protected ClassTree classtree; 1.19 + protected final ClassTree classtree; 1.20 1.21 - protected ClassDoc prev; 1.22 + protected final ClassDoc prev; 1.23 1.24 - protected ClassDoc next; 1.25 + protected final ClassDoc next; 1.26 1.27 /** 1.28 + * @param configuration the configuration data for the doclet 1.29 * @param classDoc the class being documented. 1.30 * @param prevClass the previous class that was documented. 1.31 * @param nextClass the next class being documented. 1.32 * @param classTree the class tree for the given class. 1.33 */ 1.34 - public ClassWriterImpl (ClassDoc classDoc, 1.35 + public ClassWriterImpl (ConfigurationImpl configuration, ClassDoc classDoc, 1.36 ClassDoc prevClass, ClassDoc nextClass, ClassTree classTree) 1.37 - throws Exception { 1.38 - super(ConfigurationImpl.getInstance(), DocPath.forClass(classDoc)); 1.39 + throws IOException { 1.40 + super(configuration, DocPath.forClass(classDoc)); 1.41 this.classDoc = classDoc; 1.42 configuration.currentcd = classDoc; 1.43 this.classtree = classTree; 1.44 @@ -122,7 +124,7 @@ 1.45 public Content getNavLinkPrevious() { 1.46 Content li; 1.47 if (prev != null) { 1.48 - Content prevLink = new RawHtml(getLink(new LinkInfoImpl( 1.49 + Content prevLink = new RawHtml(getLink(new LinkInfoImpl(configuration, 1.50 LinkInfoImpl.CONTEXT_CLASS, prev, "", 1.51 configuration.getText("doclet.Prev_Class"), true))); 1.52 li = HtmlTree.LI(prevLink); 1.53 @@ -140,7 +142,7 @@ 1.54 public Content getNavLinkNext() { 1.55 Content li; 1.56 if (next != null) { 1.57 - Content nextLink = new RawHtml(getLink(new LinkInfoImpl( 1.58 + Content nextLink = new RawHtml(getLink(new LinkInfoImpl(configuration, 1.59 LinkInfoImpl.CONTEXT_CLASS, next, "", 1.60 configuration.getText("doclet.Next_Class"), true))); 1.61 li = HtmlTree.LI(nextLink); 1.62 @@ -168,8 +170,8 @@ 1.63 Content pkgNameDiv = HtmlTree.DIV(HtmlStyle.subTitle, pkgNameContent); 1.64 div.addContent(pkgNameDiv); 1.65 } 1.66 - LinkInfoImpl linkInfo = new LinkInfoImpl( LinkInfoImpl.CONTEXT_CLASS_HEADER, 1.67 - classDoc, false); 1.68 + LinkInfoImpl linkInfo = new LinkInfoImpl(configuration, 1.69 + LinkInfoImpl.CONTEXT_CLASS_HEADER, classDoc, false); 1.70 //Let's not link to ourselves in the header. 1.71 linkInfo.linkToSelf = false; 1.72 Content headerContent = new StringContent(header); 1.73 @@ -228,13 +230,13 @@ 1.74 Content pre = new HtmlTree(HtmlTag.PRE); 1.75 addAnnotationInfo(classDoc, pre); 1.76 pre.addContent(modifiers); 1.77 - LinkInfoImpl linkInfo = new LinkInfoImpl( 1.78 + LinkInfoImpl linkInfo = new LinkInfoImpl(configuration, 1.79 LinkInfoImpl.CONTEXT_CLASS_SIGNATURE, classDoc, false); 1.80 //Let's not link to ourselves in the signature. 1.81 linkInfo.linkToSelf = false; 1.82 Content className = new StringContent(classDoc.name()); 1.83 Content parameterLinks = new RawHtml(getTypeParameterLinks(linkInfo)); 1.84 - if (configuration().linksource) { 1.85 + if (configuration.linksource) { 1.86 addSrcLink(classDoc, className, pre); 1.87 pre.addContent(parameterLinks); 1.88 } else { 1.89 @@ -244,11 +246,11 @@ 1.90 } 1.91 if (!isInterface) { 1.92 Type superclass = Util.getFirstVisibleSuperClass(classDoc, 1.93 - configuration()); 1.94 + configuration); 1.95 if (superclass != null) { 1.96 pre.addContent(DocletConstants.NL); 1.97 pre.addContent("extends "); 1.98 - Content link = new RawHtml(getLink(new LinkInfoImpl( 1.99 + Content link = new RawHtml(getLink(new LinkInfoImpl(configuration, 1.100 LinkInfoImpl.CONTEXT_CLASS_SIGNATURE_PARENT_NAME, 1.101 superclass))); 1.102 pre.addContent(link); 1.103 @@ -260,7 +262,7 @@ 1.104 for (int i = 0; i < implIntfacs.length; i++) { 1.105 ClassDoc classDoc = implIntfacs[i].asClassDoc(); 1.106 if (! (classDoc.isPublic() || 1.107 - Util.isLinkable(classDoc, configuration()))) { 1.108 + Util.isLinkable(classDoc, configuration))) { 1.109 continue; 1.110 } 1.111 if (counter == 0) { 1.112 @@ -269,7 +271,7 @@ 1.113 } else { 1.114 pre.addContent(", "); 1.115 } 1.116 - Content link = new RawHtml(getLink(new LinkInfoImpl( 1.117 + Content link = new RawHtml(getLink(new LinkInfoImpl(configuration, 1.118 LinkInfoImpl.CONTEXT_CLASS_SIGNATURE_PARENT_NAME, 1.119 implIntfacs[i]))); 1.120 pre.addContent(link); 1.121 @@ -315,7 +317,7 @@ 1.122 do { 1.123 sup = Util.getFirstVisibleSuperClass( 1.124 type instanceof ClassDoc ? (ClassDoc) type : type.asClassDoc(), 1.125 - configuration()); 1.126 + configuration); 1.127 if (sup != null) { 1.128 HtmlTree ul = new HtmlTree(HtmlTag.UL); 1.129 ul.addStyle(HtmlStyle.inheritance); 1.130 @@ -345,7 +347,7 @@ 1.131 Content li = new HtmlTree(HtmlTag.LI); 1.132 if (type.equals(classDoc)) { 1.133 String typeParameters = getTypeParameterLinks( 1.134 - new LinkInfoImpl(LinkInfoImpl.CONTEXT_TREE, 1.135 + new LinkInfoImpl(configuration, LinkInfoImpl.CONTEXT_TREE, 1.136 classDoc, false)); 1.137 if (configuration.shouldExcludeQualifier( 1.138 classDoc.containingPackage().name())) { 1.139 @@ -356,7 +358,7 @@ 1.140 li.addContent(new RawHtml(typeParameters)); 1.141 } 1.142 } else { 1.143 - Content link = new RawHtml(getLink(new LinkInfoImpl( 1.144 + Content link = new RawHtml(getLink(new LinkInfoImpl(configuration, 1.145 LinkInfoImpl.CONTEXT_CLASS_TREE_PARENT, 1.146 type instanceof ClassDoc ? (ClassDoc) type : type, 1.147 configuration.getClassName(type.asClassDoc()), false))); 1.148 @@ -504,8 +506,8 @@ 1.149 Content dt = HtmlTree.DT(label); 1.150 Content dl = HtmlTree.DL(dt); 1.151 Content dd = new HtmlTree(HtmlTag.DD); 1.152 - dd.addContent(new RawHtml(getLink(new LinkInfoImpl(LinkInfoImpl.CONTEXT_CLASS, outerClass, 1.153 - false)))); 1.154 + dd.addContent(new RawHtml(getLink(new LinkInfoImpl(configuration, 1.155 + LinkInfoImpl.CONTEXT_CLASS, outerClass, false)))); 1.156 dl.addContent(dd); 1.157 classInfoTree.addContent(dl); 1.158 } 1.159 @@ -549,11 +551,11 @@ 1.160 } 1.161 if (typeList[i] instanceof ClassDoc) { 1.162 Content link = new RawHtml(getLink( 1.163 - new LinkInfoImpl(context, (ClassDoc)(typeList[i])))); 1.164 + new LinkInfoImpl(configuration, context, (ClassDoc)(typeList[i])))); 1.165 dd.addContent(link); 1.166 } else { 1.167 Content link = new RawHtml(getLink( 1.168 - new LinkInfoImpl(context, (Type)(typeList[i])))); 1.169 + new LinkInfoImpl(configuration, context, (Type)(typeList[i])))); 1.170 dd.addContent(link); 1.171 } 1.172 }