src/share/classes/com/sun/tools/doclets/formats/html/LinkInfoImpl.java

changeset 1738
6ea964c78845
parent 1737
7a9ef837e57f
child 2525
2eb010b6cb22
equal deleted inserted replaced
1737:7a9ef837e57f 1738:6ea964c78845
235 /** 235 /**
236 * Construct a LinkInfo object. 236 * Construct a LinkInfo object.
237 * 237 *
238 * @param configuration the configuration data for the doclet 238 * @param configuration the configuration data for the doclet
239 * @param context the context of the link. 239 * @param context the context of the link.
240 * @param classDoc the class to link to. 240 * @param context the context of the link.
241 * @param label the label for the link. 241 * @param executableMemberDoc the member to link to.
242 * @param target the value of the target attribute.
243 */ 242 */
244 public LinkInfoImpl(ConfigurationImpl configuration, 243 public LinkInfoImpl(ConfigurationImpl configuration,
245 Kind context, ClassDoc classDoc, Content label, String target) { 244 Kind context, ExecutableMemberDoc executableMemberDoc) {
246 this.configuration = configuration; 245 this.configuration = configuration;
247 this.classDoc = classDoc; 246 this.executableMemberDoc = executableMemberDoc;
248 this.label = label;
249 this.target = target;
250 setContext(context); 247 setContext(context);
251 } 248 }
252 249
253 /** 250 /**
254 * {@inherotDoc} 251 * {@inherotDoc}
261 * Construct a LinkInfo object. 258 * Construct a LinkInfo object.
262 * 259 *
263 * @param configuration the configuration data for the doclet 260 * @param configuration the configuration data for the doclet
264 * @param context the context of the link. 261 * @param context the context of the link.
265 * @param classDoc the class to link to. 262 * @param classDoc the class to link to.
266 * @param where the value of the marker #.
267 * @param label the label for the link.
268 * @param isStrong true if the link should be strong.
269 * @param styleName String style of text defined in style sheet.
270 */ 263 */
271 public LinkInfoImpl(ConfigurationImpl configuration, 264 public LinkInfoImpl(ConfigurationImpl configuration,
272 Kind context, ClassDoc classDoc, String where, Content label, 265 Kind context, ClassDoc classDoc) {
273 boolean isStrong, String styleName) {
274 this.configuration = configuration; 266 this.configuration = configuration;
275 this.classDoc = classDoc; 267 this.classDoc = classDoc;
276 this.where = where;
277 this.label = label;
278 this.isStrong = isStrong;
279 this.styleName = styleName;
280 setContext(context);
281 }
282
283 /**
284 * Construct a LinkInfo object.
285 *
286 * @param configuration the configuration data for the doclet
287 * @param context the context of the link.
288 * @param classDoc the class to link to.
289 * @param where the value of the marker #.
290 * @param label the plain-text label for the link.
291 * @param isStrong true if the link should be strong.
292 */
293 public LinkInfoImpl(ConfigurationImpl configuration,
294 Kind context, ClassDoc classDoc, String where, String label,
295 boolean isStrong) {
296 this(configuration, context, classDoc, where, new StringContent(label),
297 isStrong, "");
298 }
299
300 /**
301 * Construct a LinkInfo object.
302 *
303 * @param configuration the configuration data for the doclet
304 * @param context the context of the link.
305 * @param classDoc the class to link to.
306 * @param where the value of the marker #.
307 * @param label the label for the link.
308 * @param isStrong true if the link should be strong.
309 */
310 public LinkInfoImpl(ConfigurationImpl configuration,
311 Kind context, ClassDoc classDoc, String where, Content label,
312 boolean isStrong) {
313 this(configuration, context, classDoc, where, label,
314 isStrong, "");
315 }
316
317 /**
318 * Construct a LinkInfo object.
319 *
320 * @param configuration the configuration data for the doclet
321 * @param classDoc the class to link to.
322 * @param label the label for the link.
323 */
324 public LinkInfoImpl(ConfigurationImpl configuration,
325 ClassDoc classDoc, Content label) {
326 this.configuration = configuration;
327 this.classDoc = classDoc;
328 this.label = label;
329 setContext(context);
330 }
331
332 /**
333 * Construct a LinkInfo object.
334 *
335 * @param configuration the configuration data for the doclet
336 * @param classDoc the class to link to.
337 * @param label the label for the link.
338 */
339 public LinkInfoImpl(ConfigurationImpl configuration,
340 ClassDoc classDoc, String label) {
341 this.configuration = configuration;
342 this.classDoc = classDoc;
343 this.label = new StringContent(label);
344 setContext(context);
345 }
346
347 /**
348 * Construct a LinkInfo object.
349 *
350 * @param configuration the configuration data for the doclet
351 * @param context the context of the link.
352 * @param executableMemberDoc the member to link to.
353 * @param isStrong true if the link should be strong.
354 */
355 public LinkInfoImpl(ConfigurationImpl configuration,
356 Kind context, ExecutableMemberDoc executableMemberDoc,
357 boolean isStrong) {
358 this.configuration = configuration;
359 this.executableMemberDoc = executableMemberDoc;
360 this.isStrong = isStrong;
361 setContext(context);
362 }
363
364 /**
365 * Construct a LinkInfo object.
366 *
367 * @param configuration the configuration data for the doclet
368 * @param context the context of the link.
369 * @param classDoc the class to link to.
370 * @param isStrong true if the link should be strong.
371 */
372 public LinkInfoImpl(ConfigurationImpl configuration,
373 Kind context, ClassDoc classDoc, boolean isStrong) {
374 this.configuration = configuration;
375 this.classDoc = classDoc;
376 this.isStrong = isStrong;
377 setContext(context); 268 setContext(context);
378 } 269 }
379 270
380 /** 271 /**
381 * Construct a LinkInfo object. 272 * Construct a LinkInfo object.
389 this.configuration = configuration; 280 this.configuration = configuration;
390 this.type = type; 281 this.type = type;
391 setContext(context); 282 setContext(context);
392 } 283 }
393 284
394 /** 285
395 * Construct a LinkInfo object. 286 /**
396 * 287 * Set the label for the link.
397 * @param configuration the configuration data for the doclet 288 * @param label plain-text label for the link
398 * @param context the context of the link. 289 */
399 * @param type the class to link to. 290 public LinkInfoImpl label(String label) {
400 * @param isVarArg true if this is a link to a var arg. 291 this.label = new StringContent(label);
401 */ 292 return this;
402 public LinkInfoImpl(ConfigurationImpl configuration, 293 }
403 Kind context, Type type, boolean isVarArg) { 294
404 this.configuration = configuration; 295 /**
405 this.type = type; 296 * Set the label for the link.
406 this.isVarArg = isVarArg; 297 */
407 setContext(context); 298 public LinkInfoImpl label(Content label) {
408 }
409
410 /**
411 * Construct a LinkInfo object.
412 *
413 * @param configuration the configuration data for the doclet
414 * @param context the context of the link.
415 * @param type the class to link to.
416 * @param label plain-text label for the link.
417 * @param isStrong true if the link should be strong.
418 */
419 public LinkInfoImpl(ConfigurationImpl configuration,
420 Kind context, Type type, String label,
421 boolean isStrong) {
422 this(configuration, context, type, new StringContent(label), isStrong);
423 }
424
425 /**
426 * Construct a LinkInfo object.
427 *
428 * @param configuration the configuration data for the doclet
429 * @param context the context of the link.
430 * @param type the class to link to.
431 * @param label the label for the link.
432 * @param isStrong true if the link should be strong.
433 */
434 public LinkInfoImpl(ConfigurationImpl configuration,
435 Kind context, Type type, Content label,
436 boolean isStrong) {
437 this.configuration = configuration;
438 this.type = type;
439 this.label = label; 299 this.label = label;
440 this.isStrong = isStrong; 300 return this;
441 setContext(context); 301 }
442 } 302
443 303 /**
444 /** 304 * Set whether or not the link should be strong.
445 * Construct a LinkInfo object. 305 */
446 * 306 public LinkInfoImpl strong(boolean strong) {
447 * @param configuration the configuration data for the doclet 307 this.isStrong = strong;
448 * @param context the context of the link. 308 return this;
449 * @param classDoc the class to link to. 309 }
450 * @param label plain-text label for the link. 310
451 * @param isStrong true if the link should be strong. 311 /**
452 */ 312 * Set the style to be used for the link.
453 public LinkInfoImpl(ConfigurationImpl configuration, 313 * @param styleName String style of text defined in style sheet.
454 Kind context, ClassDoc classDoc, String label, 314 */
455 boolean isStrong) { 315 public LinkInfoImpl styleName(String styleName) {
456 this(configuration, context, classDoc, new StringContent(label), isStrong); 316 this.styleName = styleName;
457 } 317 return this;
458 318 }
459 /** 319
460 * Construct a LinkInfo object. 320 /**
461 * 321 * Set the target to be used for the link.
462 * @param configuration the configuration data for the doclet 322 * @param styleName String style of text defined in style sheet.
463 * @param context the context of the link. 323 */
464 * @param classDoc the class to link to. 324 public LinkInfoImpl target(String target) {
465 * @param label the label for the link. 325 this.target = target;
466 * @param isStrong true if the link should be strong. 326 return this;
467 */ 327 }
468 public LinkInfoImpl(ConfigurationImpl configuration, 328
469 Kind context, ClassDoc classDoc, Content label, 329 /**
470 boolean isStrong) { 330 * Set whether or not this is a link to a varargs parameter.
471 this.configuration = configuration; 331 */
472 this.classDoc = classDoc; 332 public LinkInfoImpl varargs(boolean varargs) {
473 this.label = label; 333 this.isVarArg = varargs;
474 this.isStrong = isStrong; 334 return this;
475 setContext(context); 335 }
476 } 336
337 /**
338 * Set the fragment specifier for the link.
339 */
340 public LinkInfoImpl where(String where) {
341 this.where = where;
342 return this;
343 }
477 344
478 /** 345 /**
479 * {@inheritDoc} 346 * {@inheritDoc}
480 */ 347 */
481 public Kind getContext() { 348 public Kind getContext() {
544 break; 411 break;
545 } 412 }
546 context = c; 413 context = c;
547 if (type != null && 414 if (type != null &&
548 type.asTypeVariable()!= null && 415 type.asTypeVariable()!= null &&
549 type.asTypeVariable().owner() instanceof ExecutableMemberDoc){ 416 type.asTypeVariable().owner() instanceof ExecutableMemberDoc) {
550 excludeTypeParameterLinks = true; 417 excludeTypeParameterLinks = true;
551 } 418 }
552 } 419 }
553 420
554 /** 421 /**

mercurial