KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > javax > lang > model > element > ExecutableElement


1 /*
2  * @(#)ExecutableElement.java 1.4 06/07/11
3  *
4  * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6  */

7
8 package javax.lang.model.element;
9
10 import java.util.List JavaDoc;
11 import javax.lang.model.util.Types;
12 import javax.lang.model.type.*;
13
14 /**
15  * Represents a method, constructor, or initializer (static or
16  * instance) of a class or interface, including annotation type
17  * elements.
18  *
19  * @author Joseph D. Darcy
20  * @author Scott Seligman
21  * @author Peter von der Ahé
22  * @version 1.4 06/07/11
23  * @see ExecutableType
24  * @since 1.6
25  */

26 public interface ExecutableElement extends Element {
27     /**
28      * Returns the formal type parameters of this executable
29      * in declaration order.
30      *
31      * @return the formal type parameters, or an empty list
32      * if there are none
33      */

34     List JavaDoc<? extends TypeParameterElement> getTypeParameters();
35
36     /**
37      * Returns the return type of this executable.
38      * Returns a {@link NoType} with kind {@link TypeKind#VOID VOID}
39      * if this executable is not a method, or is a method that does not
40      * return a value.
41      *
42      * @return the return type of this executable
43      */

44     TypeMirror getReturnType();
45
46     /**
47      * Returns the formal parameters of this executable.
48      * They are returned in declaration order.
49      *
50      * @return the formal parameters,
51      * or an empty list if there are none
52      */

53     List JavaDoc<? extends VariableElement> getParameters();
54
55     /**
56      * Returns {@code true} if this method or constructor accepts a variable
57      * number of arguments and returns {@code false} otherwise.
58      *
59      * @return {@code true} if this method or constructor accepts a variable
60      * number of arguments and {@code false} otherwise
61      */

62     boolean isVarArgs();
63
64     /**
65      * Returns the exceptions and other throwables listed in this
66      * method or constructor's {@code throws} clause in declaration
67      * order.
68      *
69      * @return the exceptions and other throwables listed in the
70      * {@code throws} clause, or an empty list if there are none
71      */

72     List JavaDoc<? extends TypeMirror> getThrownTypes();
73
74     /**
75      * Returns the default value if this executable is an annotation
76      * type element. Returns {@code null} if this method is not an
77      * annotation type element, or if it is an annotation type element
78      * with no default value.
79      *
80      * @return the default value, or {@code null} if none
81      */

82     AnnotationValue getDefaultValue();
83 }
84
Popular Tags