01 /*
02 * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
03 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
04 *
05 * This code is free software; you can redistribute it and/or modify it
06 * under the terms of the GNU General Public License version 2 only, as
07 * published by the Free Software Foundation. Sun designates this
08 * particular file as subject to the "Classpath" exception as provided
09 * by Sun 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
22 * CA 95054 USA or visit www.sun.com if you need additional information or
23 * have any questions.
24 */
25
26 package javax.lang.model.type;
27
28 import java.util.List;
29
30 import javax.lang.model.element.ExecutableElement;
31
32 /**
33 * Represents the type of an executable. An <i>executable</i>
34 * is a method, constructor, or initializer.
35 *
36 * <p> The executable is
37 * represented as when viewed as a method (or constructor or
38 * initializer) of some reference type.
39 * If that reference type is parameterized, then its actual
40 * type arguments are substituted into any types returned by the methods of
41 * this interface.
42 *
43 * @author Joseph D. Darcy
44 * @author Scott Seligman
45 * @author Peter von der Ahé
46 * @version 1.10 07/05/05
47 * @see ExecutableElement
48 * @since 1.6
49 */
50 public interface ExecutableType extends TypeMirror {
51
52 /**
53 * Returns the type variables declared by the formal type parameters
54 * of this executable.
55 *
56 * @return the type variables declared by the formal type parameters,
57 * or an empty list if there are none
58 */
59 List<? extends TypeVariable> getTypeVariables();
60
61 /**
62 * Returns the return type of this executable.
63 * Returns a {@link NoType} with kind {@link TypeKind#VOID VOID}
64 * if this executable is not a method, or is a method that does not
65 * return a value.
66 *
67 * @return the return type of this executable
68 */
69 TypeMirror getReturnType();
70
71 /**
72 * Returns the types of this executable's formal parameters.
73 *
74 * @return the types of this executable's formal parameters,
75 * or an empty list if there are none
76 */
77 List<? extends TypeMirror> getParameterTypes();
78
79 /**
80 * Returns the exceptions and other throwables listed in this
81 * executable's {@code throws} clause.
82 *
83 * @return the exceptions and other throwables listed in this
84 * executable's {@code throws} clause,
85 * or an empty list if there are none.
86 */
87 List<? extends TypeMirror> getThrownTypes();
88 }
|