aboutsummaryrefslogtreecommitdiffhomepage
path: root/third_party/checker_framework_javacutil/java/org/checkerframework/javacutil/dist/ManualTaglet.java
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/checker_framework_javacutil/java/org/checkerframework/javacutil/dist/ManualTaglet.java')
-rw-r--r--third_party/checker_framework_javacutil/java/org/checkerframework/javacutil/dist/ManualTaglet.java37
1 files changed, 17 insertions, 20 deletions
diff --git a/third_party/checker_framework_javacutil/java/org/checkerframework/javacutil/dist/ManualTaglet.java b/third_party/checker_framework_javacutil/java/org/checkerframework/javacutil/dist/ManualTaglet.java
index ade653e13b..01f35485e5 100644
--- a/third_party/checker_framework_javacutil/java/org/checkerframework/javacutil/dist/ManualTaglet.java
+++ b/third_party/checker_framework_javacutil/java/org/checkerframework/javacutil/dist/ManualTaglet.java
@@ -1,22 +1,20 @@
package org.checkerframework.javacutil.dist;
-import java.util.Map;
-
import com.sun.javadoc.Tag;
import com.sun.tools.doclets.Taglet;
+import java.util.Map;
/**
* A taglet for processing the {@code @checker_framework.manual} javadoc block tag, which inserts
* references to the Checker Framework manual into javadoc.
*
- * <p>
- *
- * The {@code @checker_framework.manual} tag is used as follows:
+ * <p>The {@code @checker_framework.manual} tag is used as follows:
*
* <ul>
- * <li>{@code @checker_framework.manual #} expands to a top-level link to the Checker Framework manual
- * <li>{@code @checker_framework.manual #anchor text} expands to a link with some text to a
- * particular part of the manual
+ * <li>{@code @checker_framework.manual #} expands to a top-level link to the Checker Framework
+ * manual
+ * <li>{@code @checker_framework.manual #anchor text} expands to a link with some text to a
+ * particular part of the manual
* </ul>
*/
public class ManualTaglet implements Taglet {
@@ -65,8 +63,8 @@ public class ManualTaglet implements Taglet {
* Formats a link, given an array of tokens.
*
* @param parts the array of tokens
- * @return a link to the manual top-level if the array size is one, or a
- * link to a part of the manual if it's larger than one
+ * @return a link to the manual top-level if the array size is one, or a link to a part of the
+ * manual if it's larger than one
*/
private String formatLink(String[] parts) {
String anchor, text;
@@ -78,21 +76,18 @@ public class ManualTaglet implements Taglet {
text = parts[1];
}
return String.format(
- "<A HREF=\"http://types.cs.washington.edu/checker-framework/current/checker-framework-manual.html%s\">%s</A>",
- anchor, text);
+ "<A HREF=\"https://checkerframework.org/manual/%s\">%s</A>", anchor, text);
}
/**
- * Formats the {@code @checker_framework.manual} tag, prepending the tag header to the
- * tag content.
+ * Formats the {@code @checker_framework.manual} tag, prepending the tag header to the tag
+ * content.
*
* @param text the tag content
* @return the formatted tag
*/
private String formatHeader(String text) {
- return String.format(
- "<DT><B>See the Checker Framework Manual:</B><DD>%s<BR>",
- text);
+ return String.format("<DT><B>See the Checker Framework Manual:</B><DD>%s<BR>", text);
}
@Override
@@ -103,19 +98,21 @@ public class ManualTaglet implements Taglet {
@Override
public String toString(Tag[] tags) {
- if (tags.length == 0)
+ if (tags.length == 0) {
return "";
+ }
StringBuilder sb = new StringBuilder();
for (Tag t : tags) {
String[] split = t.text().split(" ", 2);
- if (t != tags[0])
+ if (t != tags[0]) {
sb.append(", ");
+ }
sb.append(formatLink(split));
}
return formatHeader(sb.toString());
}
- @SuppressWarnings({ "unchecked", "rawtypes" })
+ @SuppressWarnings({"unchecked", "rawtypes"})
public static void register(Map tagletMap) {
ManualTaglet tag = new ManualTaglet();
Taglet t = (Taglet) tagletMap.get(tag.getName());