Skip to content
Permalink
Browse files
8277847: Support toolGuide tag in class-level documentation
Reviewed-by: alanb, jjg
  • Loading branch information
FrauBoes committed Nov 29, 2021
1 parent 9a3a9b1 commit e3e5908d0d385ef908ba9752908aaf28b4b3e4f4
Showing 1 changed file with 9 additions and 3 deletions.
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2017, 2021, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -31,8 +31,8 @@
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import javax.lang.model.element.Element;
import javax.lang.model.element.ModuleElement;
import javax.lang.model.element.PackageElement;
import javax.lang.model.element.TypeElement;

import com.sun.source.doctree.DocTree;
import com.sun.source.doctree.UnknownBlockTagTree;
@@ -75,7 +75,7 @@ public class ToolGuide implements Taglet {
*/
@Override
public Set<Location> getAllowedLocations() {
return EnumSet.of(MODULE, PACKAGE);
return EnumSet.of(MODULE, PACKAGE, TYPE);
}

@Override
@@ -151,6 +151,12 @@ private String docRoot(Element elem) {
return pe.getEnclosingElement() != null
? "../" + pkgPart
: pkgPart;
case CLASS:
TypeElement te = (TypeElement)elem;
return te.getQualifiedName()
.toString()
.replace('.', '/')
.replaceAll("[^/]+", "..");

default:
throw new IllegalArgumentException(elem.getKind().toString());

1 comment on commit e3e5908

@openjdk-notifier
Copy link

@openjdk-notifier openjdk-notifier bot commented on e3e5908 Nov 29, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.