10
|
1 |
/*
|
15385
|
2 |
* Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
|
10
|
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
|
5520
|
7 |
* published by the Free Software Foundation. Oracle designates this
|
10
|
8 |
* particular file as subject to the "Classpath" exception as provided
|
5520
|
9 |
* by Oracle in the LICENSE file that accompanied this code.
|
10
|
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 |
*
|
5520
|
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.
|
10
|
24 |
*/
|
|
25 |
|
|
26 |
package javax.lang.model.type;
|
|
27 |
|
|
28 |
|
|
29 |
import java.util.List;
|
|
30 |
|
|
31 |
import javax.lang.model.element.ExecutableElement;
|
|
32 |
|
|
33 |
|
|
34 |
/**
|
|
35 |
* Represents the type of an executable. An <i>executable</i>
|
|
36 |
* is a method, constructor, or initializer.
|
|
37 |
*
|
|
38 |
* <p> The executable is
|
|
39 |
* represented as when viewed as a method (or constructor or
|
|
40 |
* initializer) of some reference type.
|
|
41 |
* If that reference type is parameterized, then its actual
|
|
42 |
* type arguments are substituted into any types returned by the methods of
|
|
43 |
* this interface.
|
|
44 |
*
|
|
45 |
* @author Joseph D. Darcy
|
|
46 |
* @author Scott Seligman
|
|
47 |
* @author Peter von der Ahé
|
|
48 |
* @see ExecutableElement
|
|
49 |
* @since 1.6
|
|
50 |
*/
|
|
51 |
public interface ExecutableType extends TypeMirror {
|
|
52 |
|
|
53 |
/**
|
|
54 |
* Returns the type variables declared by the formal type parameters
|
|
55 |
* of this executable.
|
|
56 |
*
|
|
57 |
* @return the type variables declared by the formal type parameters,
|
|
58 |
* or an empty list if there are none
|
|
59 |
*/
|
|
60 |
List<? extends TypeVariable> getTypeVariables();
|
|
61 |
|
|
62 |
/**
|
|
63 |
* Returns the return type of this executable.
|
|
64 |
* Returns a {@link NoType} with kind {@link TypeKind#VOID VOID}
|
|
65 |
* if this executable is not a method, or is a method that does not
|
|
66 |
* return a value.
|
|
67 |
*
|
|
68 |
* @return the return type of this executable
|
|
69 |
*/
|
|
70 |
TypeMirror getReturnType();
|
|
71 |
|
|
72 |
/**
|
|
73 |
* Returns the types of this executable's formal parameters.
|
|
74 |
*
|
|
75 |
* @return the types of this executable's formal parameters,
|
|
76 |
* or an empty list if there are none
|
|
77 |
*/
|
|
78 |
List<? extends TypeMirror> getParameterTypes();
|
|
79 |
|
|
80 |
/**
|
15385
|
81 |
* Returns the type of this executable's receiver parameter.
|
|
82 |
*
|
|
83 |
* @return the type of this executable's receiver parameter
|
|
84 |
* TODO: null if none specified or always a valid value?
|
|
85 |
*/
|
|
86 |
TypeMirror getReceiverType();
|
|
87 |
|
|
88 |
/**
|
10
|
89 |
* Returns the exceptions and other throwables listed in this
|
|
90 |
* executable's {@code throws} clause.
|
|
91 |
*
|
|
92 |
* @return the exceptions and other throwables listed in this
|
|
93 |
* executable's {@code throws} clause,
|
|
94 |
* or an empty list if there are none.
|
|
95 |
*/
|
|
96 |
List<? extends TypeMirror> getThrownTypes();
|
|
97 |
}
|