de.h2b.taglets.reflets
Class RefTaglet

java.lang.Object
  extended by de.h2b.taglets.InlineTaglet
      extended by de.h2b.taglets.reflets.RefTaglet
All Implemented Interfaces:
com.sun.tools.doclets.Taglet

@ClassLabel(copyright="Copyright (C) 2008 Hans-Hermann Bode",
            ident="$Id: RefTaglet.java,v 1.5 2008/12/14 17:05:37 h2b Exp $")
public class RefTaglet
extends InlineTaglet

An inline taglet for numerical referencing. The @ref tag is intended to be used in conjunction with the @label tag. By providing the same symbolic key as argument to both tags, an identical number will appear in the output at both places; also, a hyperlink is created that points from the reference to the label. The scope of this mechanism is limited to the file boundary.

The number is allocated by the @label tag. When using the @ref tag for a forward reference, this number is not known in the first pass of the javadoc tool, instead the symbolic key itself will appear. However, the references will be stored in an auxiliary file; so, in the second run of javadoc, the references will be there. Admittedly, this requires manual deletion of that file if new labels are inserted who disturb the numeric order; this may be done automatically by some clean operation of your development tool.

The syntax is {@ref key} or {@ref key1,key2,...}, i.e., you can reference several labels at once. Obviously, a key string must not contain a comma; furthermore, to avoid conflicts with future versions you should restrict the key string to alphanumeric characters, periods, colons, hyphens and underlines. Keys are case-sensitive. If you wish to have your reference enclosed by parentheses or something like that, you have to do it yourself.

For example, {@ref here} results in the reference 1, when label {@label here} 1 is defined here, and with {@label there} 2 you get {@ref here,there} 1, 2.

Since:
h2taglets 0.1
Version:
$Revision: 1.5 $, $Date: 2008/12/14 17:05:37 $
Author:
h2b
See Also:
LabelTaglet

Constructor Summary
RefTaglet()
          Creates this taglet.
 
Method Summary
 java.lang.String getName()
          Returns the name of this custom tag.
static void register(java.util.Map tagletMap)
          Deprecated. Use central registration of Registration instead.
 java.lang.String toString(com.sun.javadoc.Tag tag)
          Returns the processed text of the tag.
 
Methods inherited from class de.h2b.taglets.InlineTaglet
inConstructor, inField, inMethod, inOverview, inPackage, inType, isInlineTag, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RefTaglet

public RefTaglet()
Creates this taglet.

Since:
h2taglets 0.1
Method Detail

register

@Deprecated
public static void register(java.util.Map tagletMap)
Deprecated. Use central registration of Registration instead.

Registers this taglet.

Parameters:
tagletMap - the map to register this tag to
Since:
h2taglets 0.1

getName

public java.lang.String getName()
Description copied from class: InlineTaglet
Returns the name of this custom tag.

Specified by:
getName in interface com.sun.tools.doclets.Taglet
Specified by:
getName in class InlineTaglet
Returns:
taglet's name

toString

public java.lang.String toString(com.sun.javadoc.Tag tag)
Returns the processed text of the tag.

Specified by:
toString in interface com.sun.tools.doclets.Taglet
Specified by:
toString in class InlineTaglet
Parameters:
tag - the tag to be processed
Returns:
the processed text
See Also:
InlineTaglet.toString(com.sun.javadoc.Tag)


Copyright © 2008 Hans-Hermann Bode, Berlin, Germany. All Rights Reserved.