jdk/make/src/classes/build/tools/taglet/Incubating.java
author jjg
Tue, 07 Mar 2017 15:38:10 -0800
changeset 44106 55b27b5149b0
parent 43302 45de1dc92ecd
child 44123 3a090845d178
permissions -rw-r--r--
8176131: Simplify new Taglet API Reviewed-by: ksrini
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
43302
45de1dc92ecd 8173354: javadoc warning notice for types in Incubator Modules
chegar
parents:
diff changeset
     1
/*
45de1dc92ecd 8173354: javadoc warning notice for types in Incubator Modules
chegar
parents:
diff changeset
     2
 * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
45de1dc92ecd 8173354: javadoc warning notice for types in Incubator Modules
chegar
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
45de1dc92ecd 8173354: javadoc warning notice for types in Incubator Modules
chegar
parents:
diff changeset
     4
 *
45de1dc92ecd 8173354: javadoc warning notice for types in Incubator Modules
chegar
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
45de1dc92ecd 8173354: javadoc warning notice for types in Incubator Modules
chegar
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
45de1dc92ecd 8173354: javadoc warning notice for types in Incubator Modules
chegar
parents:
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
45de1dc92ecd 8173354: javadoc warning notice for types in Incubator Modules
chegar
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
45de1dc92ecd 8173354: javadoc warning notice for types in Incubator Modules
chegar
parents:
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
45de1dc92ecd 8173354: javadoc warning notice for types in Incubator Modules
chegar
parents:
diff changeset
    10
 *
45de1dc92ecd 8173354: javadoc warning notice for types in Incubator Modules
chegar
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
45de1dc92ecd 8173354: javadoc warning notice for types in Incubator Modules
chegar
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
45de1dc92ecd 8173354: javadoc warning notice for types in Incubator Modules
chegar
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
45de1dc92ecd 8173354: javadoc warning notice for types in Incubator Modules
chegar
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
45de1dc92ecd 8173354: javadoc warning notice for types in Incubator Modules
chegar
parents:
diff changeset
    15
 * accompanied this code).
45de1dc92ecd 8173354: javadoc warning notice for types in Incubator Modules
chegar
parents:
diff changeset
    16
 *
45de1dc92ecd 8173354: javadoc warning notice for types in Incubator Modules
chegar
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
45de1dc92ecd 8173354: javadoc warning notice for types in Incubator Modules
chegar
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
45de1dc92ecd 8173354: javadoc warning notice for types in Incubator Modules
chegar
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
45de1dc92ecd 8173354: javadoc warning notice for types in Incubator Modules
chegar
parents:
diff changeset
    20
 *
45de1dc92ecd 8173354: javadoc warning notice for types in Incubator Modules
chegar
parents:
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
45de1dc92ecd 8173354: javadoc warning notice for types in Incubator Modules
chegar
parents:
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
45de1dc92ecd 8173354: javadoc warning notice for types in Incubator Modules
chegar
parents:
diff changeset
    23
 * questions.
45de1dc92ecd 8173354: javadoc warning notice for types in Incubator Modules
chegar
parents:
diff changeset
    24
 */
45de1dc92ecd 8173354: javadoc warning notice for types in Incubator Modules
chegar
parents:
diff changeset
    25
45de1dc92ecd 8173354: javadoc warning notice for types in Incubator Modules
chegar
parents:
diff changeset
    26
package build.tools.taglet;
45de1dc92ecd 8173354: javadoc warning notice for types in Incubator Modules
chegar
parents:
diff changeset
    27
45de1dc92ecd 8173354: javadoc warning notice for types in Incubator Modules
chegar
parents:
diff changeset
    28
import java.util.EnumSet;
45de1dc92ecd 8173354: javadoc warning notice for types in Incubator Modules
chegar
parents:
diff changeset
    29
import java.util.List;
45de1dc92ecd 8173354: javadoc warning notice for types in Incubator Modules
chegar
parents:
diff changeset
    30
import java.util.Set;
45de1dc92ecd 8173354: javadoc warning notice for types in Incubator Modules
chegar
parents:
diff changeset
    31
import com.sun.source.doctree.DocTree;
45de1dc92ecd 8173354: javadoc warning notice for types in Incubator Modules
chegar
parents:
diff changeset
    32
import jdk.javadoc.doclet.taglet.Taglet;
45de1dc92ecd 8173354: javadoc warning notice for types in Incubator Modules
chegar
parents:
diff changeset
    33
import static jdk.javadoc.doclet.taglet.Taglet.Location.*;
45de1dc92ecd 8173354: javadoc warning notice for types in Incubator Modules
chegar
parents:
diff changeset
    34
45de1dc92ecd 8173354: javadoc warning notice for types in Incubator Modules
chegar
parents:
diff changeset
    35
/**
45de1dc92ecd 8173354: javadoc warning notice for types in Incubator Modules
chegar
parents:
diff changeset
    36
 * An inline tag to conveniently insert a standard Incubating warning.  For
45de1dc92ecd 8173354: javadoc warning notice for types in Incubator Modules
chegar
parents:
diff changeset
    37
 * use by members in Incubator Modules.
45de1dc92ecd 8173354: javadoc warning notice for types in Incubator Modules
chegar
parents:
diff changeset
    38
 */
45de1dc92ecd 8173354: javadoc warning notice for types in Incubator Modules
chegar
parents:
diff changeset
    39
public class Incubating implements Taglet {
45de1dc92ecd 8173354: javadoc warning notice for types in Incubator Modules
chegar
parents:
diff changeset
    40
45de1dc92ecd 8173354: javadoc warning notice for types in Incubator Modules
chegar
parents:
diff changeset
    41
    /** Returns the set of locations in which a taglet may be used. */
45de1dc92ecd 8173354: javadoc warning notice for types in Incubator Modules
chegar
parents:
diff changeset
    42
    @Override
45de1dc92ecd 8173354: javadoc warning notice for types in Incubator Modules
chegar
parents:
diff changeset
    43
    public Set<Location> getAllowedLocations() {
45de1dc92ecd 8173354: javadoc warning notice for types in Incubator Modules
chegar
parents:
diff changeset
    44
        return EnumSet.of(OVERVIEW, MODULE, PACKAGE, TYPE);
45de1dc92ecd 8173354: javadoc warning notice for types in Incubator Modules
chegar
parents:
diff changeset
    45
    }
45de1dc92ecd 8173354: javadoc warning notice for types in Incubator Modules
chegar
parents:
diff changeset
    46
45de1dc92ecd 8173354: javadoc warning notice for types in Incubator Modules
chegar
parents:
diff changeset
    47
    @Override
45de1dc92ecd 8173354: javadoc warning notice for types in Incubator Modules
chegar
parents:
diff changeset
    48
    public boolean isInlineTag() {
45de1dc92ecd 8173354: javadoc warning notice for types in Incubator Modules
chegar
parents:
diff changeset
    49
        return true;
45de1dc92ecd 8173354: javadoc warning notice for types in Incubator Modules
chegar
parents:
diff changeset
    50
    }
45de1dc92ecd 8173354: javadoc warning notice for types in Incubator Modules
chegar
parents:
diff changeset
    51
45de1dc92ecd 8173354: javadoc warning notice for types in Incubator Modules
chegar
parents:
diff changeset
    52
    @Override
45de1dc92ecd 8173354: javadoc warning notice for types in Incubator Modules
chegar
parents:
diff changeset
    53
    public String getName() {
45de1dc92ecd 8173354: javadoc warning notice for types in Incubator Modules
chegar
parents:
diff changeset
    54
        return "Incubating";
45de1dc92ecd 8173354: javadoc warning notice for types in Incubator Modules
chegar
parents:
diff changeset
    55
    }
45de1dc92ecd 8173354: javadoc warning notice for types in Incubator Modules
chegar
parents:
diff changeset
    56
45de1dc92ecd 8173354: javadoc warning notice for types in Incubator Modules
chegar
parents:
diff changeset
    57
    private static final String MESSAGE =
45de1dc92ecd 8173354: javadoc warning notice for types in Incubator Modules
chegar
parents:
diff changeset
    58
        "<BR><b><a href=\"http://openjdk.java.net/jeps/11\">Incubating Feature.</a>"
45de1dc92ecd 8173354: javadoc warning notice for types in Incubator Modules
chegar
parents:
diff changeset
    59
                + " Will be removed in a future release.</b>";
45de1dc92ecd 8173354: javadoc warning notice for types in Incubator Modules
chegar
parents:
diff changeset
    60
45de1dc92ecd 8173354: javadoc warning notice for types in Incubator Modules
chegar
parents:
diff changeset
    61
    @Override
45de1dc92ecd 8173354: javadoc warning notice for types in Incubator Modules
chegar
parents:
diff changeset
    62
    public String toString(List<? extends DocTree> tags) {
45de1dc92ecd 8173354: javadoc warning notice for types in Incubator Modules
chegar
parents:
diff changeset
    63
        return MESSAGE;
45de1dc92ecd 8173354: javadoc warning notice for types in Incubator Modules
chegar
parents:
diff changeset
    64
    }
45de1dc92ecd 8173354: javadoc warning notice for types in Incubator Modules
chegar
parents:
diff changeset
    65
}
45de1dc92ecd 8173354: javadoc warning notice for types in Incubator Modules
chegar
parents:
diff changeset
    66