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

Sat, 08 Sep 2012 22:43:38 -0700

author
bpatel
date
Sat, 08 Sep 2012 22:43:38 -0700
changeset 1324
fa85af323d97
parent 554
9d9f26857129
child 1357
c75be5bc5283
permissions
-rw-r--r--

7180906: Javadoc tool does not apply parameter -nosince
Reviewed-by: jjg

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

mercurial