author | darcy |
Tue, 18 Dec 2012 00:24:54 -0800 | |
changeset 14956 | 185bd7c693d8 |
parent 14258 | 8d2148961366 |
child 16557 | 67a3ae363f03 |
permissions | -rw-r--r-- |
10 | 1 |
/* |
14258 | 2 |
* Copyright (c) 2005, 2012, 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.element; |
|
27 |
||
28 |
import java.util.List; |
|
29 |
import javax.lang.model.type.*; |
|
30 |
||
31 |
/** |
|
32 |
* Represents a method, constructor, or initializer (static or |
|
33 |
* instance) of a class or interface, including annotation type |
|
34 |
* elements. |
|
35 |
* |
|
36 |
* @author Joseph D. Darcy |
|
37 |
* @author Scott Seligman |
|
38 |
* @author Peter von der Ahé |
|
39 |
* @see ExecutableType |
|
40 |
* @since 1.6 |
|
41 |
*/ |
|
2088
6e2c8594b2e5
6460529: Provide mixin interfaces for getQualifiedName and getTypeParameters
darcy
parents:
10
diff
changeset
|
42 |
public interface ExecutableElement extends Element, Parameterizable { |
10 | 43 |
/** |
44 |
* Returns the formal type parameters of this executable |
|
45 |
* in declaration order. |
|
46 |
* |
|
47 |
* @return the formal type parameters, or an empty list |
|
48 |
* if there are none |
|
49 |
*/ |
|
50 |
List<? extends TypeParameterElement> getTypeParameters(); |
|
51 |
||
52 |
/** |
|
53 |
* Returns the return type of this executable. |
|
54 |
* Returns a {@link NoType} with kind {@link TypeKind#VOID VOID} |
|
55 |
* if this executable is not a method, or is a method that does not |
|
56 |
* return a value. |
|
57 |
* |
|
58 |
* @return the return type of this executable |
|
59 |
*/ |
|
60 |
TypeMirror getReturnType(); |
|
61 |
||
62 |
/** |
|
63 |
* Returns the formal parameters of this executable. |
|
64 |
* They are returned in declaration order. |
|
65 |
* |
|
66 |
* @return the formal parameters, |
|
67 |
* or an empty list if there are none |
|
68 |
*/ |
|
69 |
List<? extends VariableElement> getParameters(); |
|
70 |
||
71 |
/** |
|
72 |
* Returns {@code true} if this method or constructor accepts a variable |
|
73 |
* number of arguments and returns {@code false} otherwise. |
|
74 |
* |
|
75 |
* @return {@code true} if this method or constructor accepts a variable |
|
76 |
* number of arguments and {@code false} otherwise |
|
77 |
*/ |
|
78 |
boolean isVarArgs(); |
|
79 |
||
80 |
/** |
|
14956
185bd7c693d8
8005046: Provide checking for a default method in javax.lang.model
darcy
parents:
14258
diff
changeset
|
81 |
* Returns {@code true} if this method is a default method and |
185bd7c693d8
8005046: Provide checking for a default method in javax.lang.model
darcy
parents:
14258
diff
changeset
|
82 |
* returns {@code false} otherwise. |
185bd7c693d8
8005046: Provide checking for a default method in javax.lang.model
darcy
parents:
14258
diff
changeset
|
83 |
* |
185bd7c693d8
8005046: Provide checking for a default method in javax.lang.model
darcy
parents:
14258
diff
changeset
|
84 |
* @return {@code true} if this method is a default method and |
185bd7c693d8
8005046: Provide checking for a default method in javax.lang.model
darcy
parents:
14258
diff
changeset
|
85 |
* {@code false} otherwise |
185bd7c693d8
8005046: Provide checking for a default method in javax.lang.model
darcy
parents:
14258
diff
changeset
|
86 |
* @since 1.8 |
185bd7c693d8
8005046: Provide checking for a default method in javax.lang.model
darcy
parents:
14258
diff
changeset
|
87 |
*/ |
185bd7c693d8
8005046: Provide checking for a default method in javax.lang.model
darcy
parents:
14258
diff
changeset
|
88 |
boolean isDefault(); |
185bd7c693d8
8005046: Provide checking for a default method in javax.lang.model
darcy
parents:
14258
diff
changeset
|
89 |
|
185bd7c693d8
8005046: Provide checking for a default method in javax.lang.model
darcy
parents:
14258
diff
changeset
|
90 |
/** |
10 | 91 |
* Returns the exceptions and other throwables listed in this |
92 |
* method or constructor's {@code throws} clause in declaration |
|
93 |
* order. |
|
94 |
* |
|
95 |
* @return the exceptions and other throwables listed in the |
|
96 |
* {@code throws} clause, or an empty list if there are none |
|
97 |
*/ |
|
98 |
List<? extends TypeMirror> getThrownTypes(); |
|
99 |
||
100 |
/** |
|
101 |
* Returns the default value if this executable is an annotation |
|
102 |
* type element. Returns {@code null} if this method is not an |
|
103 |
* annotation type element, or if it is an annotation type element |
|
104 |
* with no default value. |
|
105 |
* |
|
106 |
* @return the default value, or {@code null} if none |
|
107 |
*/ |
|
108 |
AnnotationValue getDefaultValue(); |
|
8233
fda68eae1504
7015530: Reiterate API specializations in javax.lang.model.elment subinterfaces
darcy
parents:
5520
diff
changeset
|
109 |
|
fda68eae1504
7015530: Reiterate API specializations in javax.lang.model.elment subinterfaces
darcy
parents:
5520
diff
changeset
|
110 |
/** |
fda68eae1504
7015530: Reiterate API specializations in javax.lang.model.elment subinterfaces
darcy
parents:
5520
diff
changeset
|
111 |
* Returns the simple name of a constructor, method, or |
fda68eae1504
7015530: Reiterate API specializations in javax.lang.model.elment subinterfaces
darcy
parents:
5520
diff
changeset
|
112 |
* initializer. For a constructor, the name {@code "<init>"} is |
fda68eae1504
7015530: Reiterate API specializations in javax.lang.model.elment subinterfaces
darcy
parents:
5520
diff
changeset
|
113 |
* returned, for a static initializer, the name {@code "<clinit>"} |
fda68eae1504
7015530: Reiterate API specializations in javax.lang.model.elment subinterfaces
darcy
parents:
5520
diff
changeset
|
114 |
* is returned, and for an anonymous class or instance |
fda68eae1504
7015530: Reiterate API specializations in javax.lang.model.elment subinterfaces
darcy
parents:
5520
diff
changeset
|
115 |
* initializer, an empty name is returned. |
fda68eae1504
7015530: Reiterate API specializations in javax.lang.model.elment subinterfaces
darcy
parents:
5520
diff
changeset
|
116 |
* |
fda68eae1504
7015530: Reiterate API specializations in javax.lang.model.elment subinterfaces
darcy
parents:
5520
diff
changeset
|
117 |
* @return the simple name of a constructor, method, or |
fda68eae1504
7015530: Reiterate API specializations in javax.lang.model.elment subinterfaces
darcy
parents:
5520
diff
changeset
|
118 |
* initializer |
fda68eae1504
7015530: Reiterate API specializations in javax.lang.model.elment subinterfaces
darcy
parents:
5520
diff
changeset
|
119 |
*/ |
fda68eae1504
7015530: Reiterate API specializations in javax.lang.model.elment subinterfaces
darcy
parents:
5520
diff
changeset
|
120 |
@Override |
fda68eae1504
7015530: Reiterate API specializations in javax.lang.model.elment subinterfaces
darcy
parents:
5520
diff
changeset
|
121 |
Name getSimpleName(); |
10 | 122 |
} |