TypeParameterTree.java revision 2571:10fc81ac75b4
159191Skris/*
259191Skris * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
359191Skris * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
459191Skris *
559191Skris * This code is free software; you can redistribute it and/or modify it
659191Skris * under the terms of the GNU General Public License version 2 only, as
759191Skris * published by the Free Software Foundation.  Oracle designates this
859191Skris * particular file as subject to the "Classpath" exception as provided
959191Skris * by Oracle in the LICENSE file that accompanied this code.
1059191Skris *
11109998Smarkm * This code is distributed in the hope that it will be useful, but WITHOUT
1259191Skris * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
1359191Skris * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
1459191Skris * version 2 for more details (a copy is included in the LICENSE file that
1559191Skris * accompanied this code).
1659191Skris *
1759191Skris * You should have received a copy of the GNU General Public License version
1859191Skris * 2 along with this work; if not, write to the Free Software Foundation,
1959191Skris * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
2059191Skris *
2159191Skris * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2259191Skris * or visit www.oracle.com if you need additional information or have any
2359191Skris * questions.
2459191Skris */
2559191Skris
2659191Skrispackage com.sun.source.tree;
2759191Skris
2859191Skrisimport java.util.List;
2959191Skrisimport javax.lang.model.element.Name;
30109998Smarkm
3159191Skris/**
3259191Skris * A tree node for a type parameter.
3359191Skris *
3459191Skris * For example:
3559191Skris * <pre>
3659191Skris *   <em>name</em>
37 *
38 *   <em>name</em> extends <em>bounds</em>
39 *
40 *   <em>annotations</em> <em>name</em>
41 * </pre>
42 *
43 * @jls section 4.4
44 *
45 * @author Peter von der Ah&eacute;
46 * @author Jonathan Gibbons
47 * @since 1.6
48 */
49@jdk.Exported
50public interface TypeParameterTree extends Tree {
51    /**
52     * Returns the name of the type parameter.
53     * @return the name
54     */
55    Name getName();
56
57    /**
58     * Returns the bounds of the type parameter.
59     * @return the bounds
60     */
61    List<? extends Tree> getBounds();
62
63    /**
64     * Returns annotations on the type parameter declaration.
65     *
66     * Annotations need Target meta-annotations of
67     * {@link java.lang.annotation.ElementType#TYPE_PARAMETER} or
68     * {@link java.lang.annotation.ElementType#TYPE_USE}
69     * to appear in this position.
70     *
71     * @return annotations on the type parameter declaration
72     * @since 1.8
73     */
74    List<? extends AnnotationTree> getAnnotations();
75}
76