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

Tue, 09 Oct 2012 19:10:00 -0700

author
jjg
date
Tue, 09 Oct 2012 19:10:00 -0700
changeset 1357
c75be5bc5283
parent 554
9d9f26857129
child 1359
25e14ad23cef
permissions
-rw-r--r--

8000663: clean up langtools imports
Reviewed-by: darcy

     1 /*
     2  * Copyright (c) 2003, 2012, 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.*;
    30 /**
    31  * An abstract class for that implements the {@link Taglet} interface.
    32  *
    33  * This code is not part of an API.
    34  * It is implementation that is subject to change.
    35  * Do not use it as an API
    36  *
    37  * @author Jamie Ho
    38  * @since 1.4
    39  */
    40 public abstract class BaseTaglet implements Taglet {
    42     protected String name = "Default";
    44     /**
    45      * Return true if this <code>Taglet</code>
    46      * is used in constructor documentation.
    47      * @return true if this <code>Taglet</code>
    48      * is used in constructor documentation and false
    49      * otherwise.
    50      */
    51     public boolean inConstructor() {
    52         return true;
    53     }
    55     /**
    56      * Return true if this <code>Taglet</code>
    57      * is used in field documentation.
    58      * @return true if this <code>Taglet</code>
    59      * is used in field documentation and false
    60      * otherwise.
    61      */
    62     public boolean inField() {
    63         return true;
    64     }
    66     /**
    67      * Return true if this <code>Taglet</code>
    68      * is used in method documentation.
    69      * @return true if this <code>Taglet</code>
    70      * is used in method documentation and false
    71      * otherwise.
    72      */
    73     public boolean inMethod() {
    74         return true;
    75     }
    77     /**
    78      * Return true if this <code>Taglet</code>
    79      * is used in overview documentation.
    80      * @return true if this <code>Taglet</code>
    81      * is used in method documentation and false
    82      * otherwise.
    83      */
    84     public boolean inOverview() {
    85         return true;
    86     }
    88     /**
    89      * Return true if this <code>Taglet</code>
    90      * is used in package documentation.
    91      * @return true if this <code>Taglet</code>
    92      * is used in package documentation and false
    93      * otherwise.
    94      */
    95     public boolean inPackage() {
    96         return true;
    97     }
    99     /**
   100      * Return true if this <code>Taglet</code>
   101      * is used in type documentation (classes or interfaces).
   102      * @return true if this <code>Taglet</code>
   103      * is used in type documentation and false
   104      * otherwise.
   105      */
   106     public boolean inType() {
   107         return true;
   108     }
   110     /**
   111      * Return true if this <code>Taglet</code>
   112      * is an inline tag.
   113      * @return true if this <code>Taglet</code>
   114      * is an inline tag and false otherwise.
   115      */
   116     public boolean isInlineTag() {
   117         return false;
   118     }
   120     /**
   121      * Return the name of this custom tag.
   122      * @return the name of this custom tag.
   123      */
   124     public String getName() {
   125         return name;
   126     }
   128     /**
   129      * {@inheritDoc}
   130      * @throws IllegalArgumentException thrown when the method is not supported by the taglet.
   131      */
   132     public TagletOutput getTagletOutput(Tag tag, TagletWriter writer) {
   133         throw new IllegalArgumentException("Method not supported in taglet " + getName() + ".");
   134     }
   136     /**
   137      * {@inheritDoc}
   138      * @throws IllegalArgumentException thrown when the method is not supported by the taglet.
   139      */
   140     public TagletOutput getTagletOutput(Doc holder, TagletWriter writer) {
   141         throw new IllegalArgumentException("Method not supported in taglet " + getName() + ".");
   142     }
   143 }

mercurial