de.h2b.taglets
Class Registration

java.lang.Object
  extended by de.h2b.taglets.Registration
All Implemented Interfaces:
java.lang.Runnable

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

A singleton that provides a static register method as a single entry point for the javadoc tool. In this way, all taglets of this project will be registered to the map of custom tags at once.

Note that this single entry point is not only made available for convenience but is also required for taglets like CiteTaglet and BiblioTaglet which have cross-reference dependencies on each other and thus are reliant on shared objects. Apparently, with the current javadoc-tool implementation even singletons are not shared at least by inline and block taglets when registered separately.

During registration, also the CrossRefMap is loaded from a file and measure is taken to save the map at shutdown. For this reason, this class implements Runnable.

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

Field Summary
protected static CrossRefMap XREF_MAP
          The map that stores the cross-ref tables.
protected static java.io.File XREF_MAP_FILE
          The file that stores the cross-ref map.
 
Method Summary
static void register(java.util.Map tagletMap)
          Registers all taglets of this project.
protected static void register(java.util.Map tagletMap, com.sun.tools.doclets.Taglet taglet)
          Registers a taglet.
 void run()
          Serves as entry point for Runnable interface.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

XREF_MAP

protected static final CrossRefMap XREF_MAP
The map that stores the cross-ref tables.

Since:
h2taglets 0.1

XREF_MAP_FILE

protected static final java.io.File XREF_MAP_FILE
The file that stores the cross-ref map.

Since:
h2taglets 0.1
Method Detail

register

public static void register(java.util.Map tagletMap)
Registers all taglets of this project. Will be called by javadoc tool.

Parameters:
tagletMap - the map to register the taglets to
Since:
h2taglets 0.1

register

protected static void register(java.util.Map tagletMap,
                               com.sun.tools.doclets.Taglet taglet)
Registers a taglet.

Implementation note: In the current version of the javadoc tool the map of custom tags consists of key-value pairs with values of an internal type com.sun.tools.doclets.internal.toolkit.taglets.Taglet. Therefore, taglets of type com.sun.tools.doclets.Taglet, which are used in this project, have to be converted to the internal interface. The TagletManager of the internal toolkit will do this automatically only for the last entry added to the map at a single registration, so we have to do the conversion explicitly here. This can be done by creating a LegacyTaglet; beware that the documentation of this class notes: This code is not part of an API. It is implementation that is subject to change. Do not use it as an API.

Parameters:
tagletMap - the map to register the taglet to
taglet - the taglet to be registered
Since:
h2taglets 0.1
See Also:
LegacyTaglet, LegacyTaglet.LegacyTaglet(Taglet), TagletManager.addCustomTag(String, String), TagletManager.checkTaglet(java.lang.Object)

run

public void run()
Serves as entry point for Runnable interface.

Specified by:
run in interface java.lang.Runnable
Since:
h2taglets 0.1


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