src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/CodeTaglet.java

Print this page

        

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2016, 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
  * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.  Oracle designates this

@@ -21,16 +21,21 @@
  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  * or visit www.oracle.com if you need additional information or have any
  * questions.
  */
 
-package com.sun.tools.doclets.internal.toolkit.taglets;
+package jdk.javadoc.internal.doclets.toolkit.taglets;
 
 import java.util.Map;
-import com.sun.javadoc.Tag;
-import com.sun.tools.doclets.internal.toolkit.Content;
 
+import javax.lang.model.element.Element;
+
+import com.sun.source.doctree.DocTree;
+import jdk.javadoc.internal.doclets.toolkit.Content;
+
+import static com.sun.source.doctree.DocTree.Kind.*;
+
 /**
  * An inline Taglet used to denote literal code fragments.
  * The enclosed text is interpreted as not containing HTML markup or
  * nested javadoc tags, and is rendered in a font suitable for code.
  *

@@ -50,23 +55,18 @@
  * @since 1.5
  */
 
 public class CodeTaglet extends BaseInlineTaglet {
 
-    private static final String NAME = "code";
+    private static final String NAME = CODE.tagName;
 
-    public static void register(Map<String, Taglet> map) {
-        map.remove(NAME);
-        map.put(NAME, new CodeTaglet());
-    }
-
     public String getName() {
         return NAME;
     }
 
     /**
      * {@inheritDoc}
      */
-    public Content getTagletOutput(Tag tag, TagletWriter writer) {
-        return writer.codeTagOutput(tag);
+    public Content getTagletOutput(Element element, DocTree tag, TagletWriter writer) {
+        return writer.codeTagOutput(element, tag);
     }
 }