Loki.yggdrasill.info


Own Javadoc Tags

Posted in development, java by Loki on the August 3rd, 2007

To apply your own javadoc tags, you need only a actual JDK and specially the interface com.sun.tools.doclets.Taglet. Implement this and add a method register like the following:

public static void register(Map tagletMap) {
CustomTag tag = new CustomTag();
Taglet t = (Taglet) tagletMap.get(tag.getName());
if (t != null) {
tagletMap.remove(tag.getName());
}
tagletMap.put(tag.getName(), tag);
}

then you can pack your new taglet class to an jar and try this parameters on javadoc execution -taglet CustomTag -tagletpath /path/to/tagletExt.jar in this example I use no package for the CustomTag class, so the taglet is CustomTag without package prefix

See also for more: