1.1 --- a/src/share/classes/com/sun/tools/doclets/formats/html/LinkInfoImpl.java Tue May 14 10:14:52 2013 -0700 1.2 +++ b/src/share/classes/com/sun/tools/doclets/formats/html/LinkInfoImpl.java Tue May 14 10:14:52 2013 -0700 1.3 @@ -237,16 +237,13 @@ 1.4 * 1.5 * @param configuration the configuration data for the doclet 1.6 * @param context the context of the link. 1.7 - * @param classDoc the class to link to. 1.8 - * @param label the label for the link. 1.9 - * @param target the value of the target attribute. 1.10 + * @param context the context of the link. 1.11 + * @param executableMemberDoc the member to link to. 1.12 */ 1.13 public LinkInfoImpl(ConfigurationImpl configuration, 1.14 - Kind context, ClassDoc classDoc, Content label, String target) { 1.15 + Kind context, ExecutableMemberDoc executableMemberDoc) { 1.16 this.configuration = configuration; 1.17 - this.classDoc = classDoc; 1.18 - this.label = label; 1.19 - this.target = target; 1.20 + this.executableMemberDoc = executableMemberDoc; 1.21 setContext(context); 1.22 } 1.23 1.24 @@ -263,117 +260,11 @@ 1.25 * @param configuration the configuration data for the doclet 1.26 * @param context the context of the link. 1.27 * @param classDoc the class to link to. 1.28 - * @param where the value of the marker #. 1.29 - * @param label the label for the link. 1.30 - * @param isStrong true if the link should be strong. 1.31 - * @param styleName String style of text defined in style sheet. 1.32 */ 1.33 public LinkInfoImpl(ConfigurationImpl configuration, 1.34 - Kind context, ClassDoc classDoc, String where, Content label, 1.35 - boolean isStrong, String styleName) { 1.36 + Kind context, ClassDoc classDoc) { 1.37 this.configuration = configuration; 1.38 this.classDoc = classDoc; 1.39 - this.where = where; 1.40 - this.label = label; 1.41 - this.isStrong = isStrong; 1.42 - this.styleName = styleName; 1.43 - setContext(context); 1.44 - } 1.45 - 1.46 - /** 1.47 - * Construct a LinkInfo object. 1.48 - * 1.49 - * @param configuration the configuration data for the doclet 1.50 - * @param context the context of the link. 1.51 - * @param classDoc the class to link to. 1.52 - * @param where the value of the marker #. 1.53 - * @param label the plain-text label for the link. 1.54 - * @param isStrong true if the link should be strong. 1.55 - */ 1.56 - public LinkInfoImpl(ConfigurationImpl configuration, 1.57 - Kind context, ClassDoc classDoc, String where, String label, 1.58 - boolean isStrong) { 1.59 - this(configuration, context, classDoc, where, new StringContent(label), 1.60 - isStrong, ""); 1.61 - } 1.62 - 1.63 - /** 1.64 - * Construct a LinkInfo object. 1.65 - * 1.66 - * @param configuration the configuration data for the doclet 1.67 - * @param context the context of the link. 1.68 - * @param classDoc the class to link to. 1.69 - * @param where the value of the marker #. 1.70 - * @param label the label for the link. 1.71 - * @param isStrong true if the link should be strong. 1.72 - */ 1.73 - public LinkInfoImpl(ConfigurationImpl configuration, 1.74 - Kind context, ClassDoc classDoc, String where, Content label, 1.75 - boolean isStrong) { 1.76 - this(configuration, context, classDoc, where, label, 1.77 - isStrong, ""); 1.78 - } 1.79 - 1.80 - /** 1.81 - * Construct a LinkInfo object. 1.82 - * 1.83 - * @param configuration the configuration data for the doclet 1.84 - * @param classDoc the class to link to. 1.85 - * @param label the label for the link. 1.86 - */ 1.87 - public LinkInfoImpl(ConfigurationImpl configuration, 1.88 - ClassDoc classDoc, Content label) { 1.89 - this.configuration = configuration; 1.90 - this.classDoc = classDoc; 1.91 - this.label = label; 1.92 - setContext(context); 1.93 - } 1.94 - 1.95 - /** 1.96 - * Construct a LinkInfo object. 1.97 - * 1.98 - * @param configuration the configuration data for the doclet 1.99 - * @param classDoc the class to link to. 1.100 - * @param label the label for the link. 1.101 - */ 1.102 - public LinkInfoImpl(ConfigurationImpl configuration, 1.103 - ClassDoc classDoc, String label) { 1.104 - this.configuration = configuration; 1.105 - this.classDoc = classDoc; 1.106 - this.label = new StringContent(label); 1.107 - setContext(context); 1.108 - } 1.109 - 1.110 - /** 1.111 - * Construct a LinkInfo object. 1.112 - * 1.113 - * @param configuration the configuration data for the doclet 1.114 - * @param context the context of the link. 1.115 - * @param executableMemberDoc the member to link to. 1.116 - * @param isStrong true if the link should be strong. 1.117 - */ 1.118 - public LinkInfoImpl(ConfigurationImpl configuration, 1.119 - Kind context, ExecutableMemberDoc executableMemberDoc, 1.120 - boolean isStrong) { 1.121 - this.configuration = configuration; 1.122 - this.executableMemberDoc = executableMemberDoc; 1.123 - this.isStrong = isStrong; 1.124 - setContext(context); 1.125 - } 1.126 - 1.127 - /** 1.128 - * Construct a LinkInfo object. 1.129 - * 1.130 - * @param configuration the configuration data for the doclet 1.131 - * @param context the context of the link. 1.132 - * @param classDoc the class to link to. 1.133 - * @param isStrong true if the link should be strong. 1.134 - */ 1.135 - public LinkInfoImpl(ConfigurationImpl configuration, 1.136 - Kind context, ClassDoc classDoc, boolean isStrong) { 1.137 - this.configuration = configuration; 1.138 - this.classDoc = classDoc; 1.139 - this.isStrong = isStrong; 1.140 setContext(context); 1.141 } 1.142 1.143 @@ -391,91 +282,67 @@ 1.144 setContext(context); 1.145 } 1.146 1.147 + 1.148 /** 1.149 - * Construct a LinkInfo object. 1.150 - * 1.151 - * @param configuration the configuration data for the doclet 1.152 - * @param context the context of the link. 1.153 - * @param type the class to link to. 1.154 - * @param isVarArg true if this is a link to a var arg. 1.155 + * Set the label for the link. 1.156 + * @param label plain-text label for the link 1.157 */ 1.158 - public LinkInfoImpl(ConfigurationImpl configuration, 1.159 - Kind context, Type type, boolean isVarArg) { 1.160 - this.configuration = configuration; 1.161 - this.type = type; 1.162 - this.isVarArg = isVarArg; 1.163 - setContext(context); 1.164 + public LinkInfoImpl label(String label) { 1.165 + this.label = new StringContent(label); 1.166 + return this; 1.167 } 1.168 1.169 /** 1.170 - * Construct a LinkInfo object. 1.171 - * 1.172 - * @param configuration the configuration data for the doclet 1.173 - * @param context the context of the link. 1.174 - * @param type the class to link to. 1.175 - * @param label plain-text label for the link. 1.176 - * @param isStrong true if the link should be strong. 1.177 + * Set the label for the link. 1.178 */ 1.179 - public LinkInfoImpl(ConfigurationImpl configuration, 1.180 - Kind context, Type type, String label, 1.181 - boolean isStrong) { 1.182 - this(configuration, context, type, new StringContent(label), isStrong); 1.183 + public LinkInfoImpl label(Content label) { 1.184 + this.label = label; 1.185 + return this; 1.186 } 1.187 1.188 /** 1.189 - * Construct a LinkInfo object. 1.190 - * 1.191 - * @param configuration the configuration data for the doclet 1.192 - * @param context the context of the link. 1.193 - * @param type the class to link to. 1.194 - * @param label the label for the link. 1.195 - * @param isStrong true if the link should be strong. 1.196 + * Set whether or not the link should be strong. 1.197 */ 1.198 - public LinkInfoImpl(ConfigurationImpl configuration, 1.199 - Kind context, Type type, Content label, 1.200 - boolean isStrong) { 1.201 - this.configuration = configuration; 1.202 - this.type = type; 1.203 - this.label = label; 1.204 - this.isStrong = isStrong; 1.205 - setContext(context); 1.206 + public LinkInfoImpl strong(boolean strong) { 1.207 + this.isStrong = strong; 1.208 + return this; 1.209 } 1.210 1.211 /** 1.212 - * Construct a LinkInfo object. 1.213 - * 1.214 - * @param configuration the configuration data for the doclet 1.215 - * @param context the context of the link. 1.216 - * @param classDoc the class to link to. 1.217 - * @param label plain-text label for the link. 1.218 - * @param isStrong true if the link should be strong. 1.219 + * Set the style to be used for the link. 1.220 + * @param styleName String style of text defined in style sheet. 1.221 */ 1.222 - public LinkInfoImpl(ConfigurationImpl configuration, 1.223 - Kind context, ClassDoc classDoc, String label, 1.224 - boolean isStrong) { 1.225 - this(configuration, context, classDoc, new StringContent(label), isStrong); 1.226 + public LinkInfoImpl styleName(String styleName) { 1.227 + this.styleName = styleName; 1.228 + return this; 1.229 } 1.230 1.231 /** 1.232 - * Construct a LinkInfo object. 1.233 - * 1.234 - * @param configuration the configuration data for the doclet 1.235 - * @param context the context of the link. 1.236 - * @param classDoc the class to link to. 1.237 - * @param label the label for the link. 1.238 - * @param isStrong true if the link should be strong. 1.239 + * Set the target to be used for the link. 1.240 + * @param styleName String style of text defined in style sheet. 1.241 */ 1.242 - public LinkInfoImpl(ConfigurationImpl configuration, 1.243 - Kind context, ClassDoc classDoc, Content label, 1.244 - boolean isStrong) { 1.245 - this.configuration = configuration; 1.246 - this.classDoc = classDoc; 1.247 - this.label = label; 1.248 - this.isStrong = isStrong; 1.249 - setContext(context); 1.250 + public LinkInfoImpl target(String target) { 1.251 + this.target = target; 1.252 + return this; 1.253 } 1.254 1.255 /** 1.256 + * Set whether or not this is a link to a varargs parameter. 1.257 + */ 1.258 + public LinkInfoImpl varargs(boolean varargs) { 1.259 + this.isVarArg = varargs; 1.260 + return this; 1.261 + } 1.262 + 1.263 + /** 1.264 + * Set the fragment specifier for the link. 1.265 + */ 1.266 + public LinkInfoImpl where(String where) { 1.267 + this.where = where; 1.268 + return this; 1.269 + } 1.270 + 1.271 + /** 1.272 * {@inheritDoc} 1.273 */ 1.274 public Kind getContext() { 1.275 @@ -546,7 +413,7 @@ 1.276 context = c; 1.277 if (type != null && 1.278 type.asTypeVariable()!= null && 1.279 - type.asTypeVariable().owner() instanceof ExecutableMemberDoc){ 1.280 + type.asTypeVariable().owner() instanceof ExecutableMemberDoc) { 1.281 excludeTypeParameterLinks = true; 1.282 } 1.283 }