src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/BaseTaglet.java

Wed, 27 Apr 2016 01:34:52 +0800

author
aoqi
date
Wed, 27 Apr 2016 01:34:52 +0800
changeset 0
959103a6100f
child 2525
2eb010b6cb22
permissions
-rw-r--r--

Initial load
http://hg.openjdk.java.net/jdk8u/jdk8u/langtools/
changeset: 2573:53ca196be1ae
tag: jdk8u25-b17

     1 /*
     2  * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.  Oracle designates this
     8  * particular file as subject to the "Classpath" exception as provided
     9  * by Oracle in the LICENSE file that accompanied this code.
    10  *
    11  * This code is distributed in the hope that it will be useful, but WITHOUT
    12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
    14  * version 2 for more details (a copy is included in the LICENSE file that
    15  * accompanied this code).
    16  *
    17  * You should have received a copy of the GNU General Public License version
    18  * 2 along with this work; if not, write to the Free Software Foundation,
    19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    20  *
    21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
    22  * or visit www.oracle.com if you need additional information or have any
    23  * questions.
    24  */
    26 package com.sun.tools.doclets.internal.toolkit.taglets;
    28 import com.sun.javadoc.*;
    29 import com.sun.tools.doclets.internal.toolkit.Content;
    31 /**
    32  * An abstract class for that implements the {@link Taglet} interface.
    33  *
    34  *  <p><b>This is NOT part of any supported API.
    35  *  If you write code that depends on this, you do so at your own risk.
    36  *  This code and its internal interfaces are subject to change or
    37  *  deletion without notice.</b>
    38  *
    39  * @author Jamie Ho
    40  * @since 1.4
    41  */
    42 public abstract class BaseTaglet implements Taglet {
    44     protected String name = "Default";
    46     /**
    47      * Return true if this <code>Taglet</code>
    48      * is used in constructor documentation.
    49      * @return true if this <code>Taglet</code>
    50      * is used in constructor documentation and false
    51      * otherwise.
    52      */
    53     public boolean inConstructor() {
    54         return true;
    55     }
    57     /**
    58      * Return true if this <code>Taglet</code>
    59      * is used in field documentation.
    60      * @return true if this <code>Taglet</code>
    61      * is used in field documentation and false
    62      * otherwise.
    63      */
    64     public boolean inField() {
    65         return true;
    66     }
    68     /**
    69      * Return true if this <code>Taglet</code>
    70      * is used in method documentation.
    71      * @return true if this <code>Taglet</code>
    72      * is used in method documentation and false
    73      * otherwise.
    74      */
    75     public boolean inMethod() {
    76         return true;
    77     }
    79     /**
    80      * Return true if this <code>Taglet</code>
    81      * is used in overview documentation.
    82      * @return true if this <code>Taglet</code>
    83      * is used in method documentation and false
    84      * otherwise.
    85      */
    86     public boolean inOverview() {
    87         return true;
    88     }
    90     /**
    91      * Return true if this <code>Taglet</code>
    92      * is used in package documentation.
    93      * @return true if this <code>Taglet</code>
    94      * is used in package documentation and false
    95      * otherwise.
    96      */
    97     public boolean inPackage() {
    98         return true;
    99     }
   101     /**
   102      * Return true if this <code>Taglet</code>
   103      * is used in type documentation (classes or interfaces).
   104      * @return true if this <code>Taglet</code>
   105      * is used in type documentation and false
   106      * otherwise.
   107      */
   108     public boolean inType() {
   109         return true;
   110     }
   112     /**
   113      * Return true if this <code>Taglet</code>
   114      * is an inline tag.
   115      * @return true if this <code>Taglet</code>
   116      * is an inline tag and false otherwise.
   117      */
   118     public boolean isInlineTag() {
   119         return false;
   120     }
   122     /**
   123      * Return the name of this custom tag.
   124      * @return the name of this custom tag.
   125      */
   126     public String getName() {
   127         return name;
   128     }
   130     /**
   131      * {@inheritDoc}
   132      * @throws IllegalArgumentException thrown when the method is not supported by the taglet.
   133      */
   134     public Content getTagletOutput(Tag tag, TagletWriter writer) {
   135         throw new IllegalArgumentException("Method not supported in taglet " + getName() + ".");
   136     }
   138     /**
   139      * {@inheritDoc}
   140      * @throws IllegalArgumentException thrown when the method is not supported by the taglet.
   141      */
   142     public Content getTagletOutput(Doc holder, TagletWriter writer) {
   143         throw new IllegalArgumentException("Method not supported in taglet " + getName() + ".");
   144     }
   145 }

mercurial