Source code: javax/ide/model/java/declaration/MethodD.java
1 /*
2 * @(#)MethodD.java
3 */
4
5 package javax.ide.model.java.declaration;
6
7 /**
8 * Mirrors a method or annotation element. <p/>
9 *
10 * An annotation element MUST be a MethodM because annotation types
11 * may be extended/implemented where an annotation element will be
12 * treated like an ordinary interface method. <p/>
13 *
14 * @author Andy Yu
15 */
16 public interface MethodD
17 extends ExecutableD, HasNameD, HasTypeD
18 {
19 // ----------------------------------------------------------------------
20
21 /**
22 * True if this is an annotation element.
23 *
24 * @return True if this is an annotation element.
25 */
26 public boolean isAnnotationElement();
27
28 /**
29 * True if this is modified with "synchronized".
30 *
31 * @return True if this is modified with "synchronized".
32 */
33 public boolean isSynchronized();
34
35 /**
36 * True if marked as a bridge method.
37 *
38 * @return True if marked as a bridge method.
39 */
40 public boolean isBridge();
41
42 /**
43 * True if this is modified with "native".
44 *
45 * @return True if this is modified with "native".
46 */
47 public boolean isNative();
48
49 /**
50 * True if this is modified with "abstract".
51 *
52 * @return True if this is modified with "abstract".
53 */
54 public boolean isAbstract();
55
56 /**
57 * True if this is modified with "strictfp".
58 *
59 * @return True if this is modified with "strictfp".
60 */
61 public boolean isStrictfp();
62
63
64 // ----------------------------------------------------------------------
65
66 /**
67 * Gets the default value, null if this is not an annotation
68 * element. <p/>
69 *
70 * @return An object representing the default value:
71 *
72 * <ul>
73 *
74 * <li> A value of a primitive type gets returned as an instance of its
75 * appropriate wrapper class (e.g. Integer).
76 *
77 * <li> A String value gets returned as a String instance.
78 *
79 * <li> A class reference gets returned as a TypeM instance.
80 *
81 * <li> An annotation gets returned as an AnnotationM instance.
82 *
83 * <li> An array gets returned as a Collection<Object>, one element
84 * for each value.
85 *
86 * </ul>
87 *
88 */
89 public Object getDefaultValue();
90
91 /**
92 * Gets the return type.
93 *
94 * @return The type declaration for the return type of this method.
95 */
96 public TypeD getReturnType();
97 }