Debian Codegraph @

lang-model/src/main/java/jakarta/enterprise/lang/model/declarations/ParameterInfo.java

raw
1 package jakarta.enterprise.lang.model.declarations;
2
3 import jakarta.enterprise.lang.model.types.Type;
4
5 /**
6 * A method parameter or a constructor parameter, {@linkplain #declaringMethod() declared} in some method
7 * or constructor.
8 *
9 * @since 4.0
10 */
11 public interface ParameterInfo extends DeclarationInfo {
12 /**
13 * Returns the name of this parameter, if it is known. Method parameter names may not always be known,
14 * in which case a synthetic name of the form {@code argN}, where {@code N} is zero-based parameter position
15 * in the method declaration, is returned.
16 *
17 * @return the name of this parameter, or a synthetic name, never {@code null}
18 */
19 String name();
20
21 /**
22 * Returns the {@linkplain Type type} of this parameter.
23 *
24 * @return the {@linkplain Type type} of this parameter, never {@code null}
25 */
26 Type type();
27
28 /**
29 * Returns the {@linkplain MethodInfo method} that declares this parameter.
30 *
31 * @return the {@linkplain MethodInfo method} that declares this parameter, never {@code null}
32 */
33 MethodInfo declaringMethod();
34
35 // ---
36
37 @Override
38 default Kind kind() {
39 return Kind.PARAMETER;
40 }
41
42 @Override
43 default ParameterInfo asParameter() {
44 return this;
45 }
46 }