• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
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
7  * published by the Free Software Foundation.  Oracle designates this
8  * particular file as subject to the "Classpath" exception as provided
9  * by Oracle in the LICENSE file that accompanied this code.
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  *
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.
24  */
25 
26 package com.sun.javadoc;
27 
28 import com.google.doclava.annotation.Unused;
29 import com.google.doclava.annotation.Used;
30 
31 /**
32  * Represents a method or constructor of a java class.
33  *
34  * @since 1.2
35  * @author Robert Field
36  */
37 public interface ExecutableMemberDoc extends MemberDoc {
38 
39     /**
40      * Return exceptions this method or constructor throws.
41      * If the type of the exception is a type variable, return the
42      * <code>ClassDoc</code> of its erasure.
43      *
44      * <p> <i>The <code>thrownExceptions</code> method cannot
45      * accommodate certain generic type constructs.  The
46      * <code>thrownExceptionTypes</code> method should be used
47      * instead.</i>
48      *
49      * @return an array of ClassDoc[] representing the exceptions
50      *         thrown by this method.
51      * @see #thrownExceptionTypes
52      */
53     @Used
thrownExceptions()54     ClassDoc[] thrownExceptions();
55 
56     /**
57      * Return exceptions this method or constructor throws.
58      *
59      * @return an array representing the exceptions thrown by this method.
60      *         Each array element is either a <code>ClassDoc</code> or a
61      *         <code>TypeVariable</code>.
62      * @since 1.5
63      */
64     @Unused
thrownExceptionTypes()65     Type[] thrownExceptionTypes();
66 
67     /**
68      * Return true if this method is native
69      */
70     @Used
isNative()71     boolean isNative();
72 
73     /**
74      * Return true if this method is synchronized
75      */
76     @Used
isSynchronized()77     boolean isSynchronized();
78 
79     /**
80      * Return true if this method was declared to take a variable number
81      * of arguments.
82      *
83      * @since 1.5
84      */
85     @Used
isVarArgs()86     boolean isVarArgs();
87 
88     /**
89      * Get argument information.
90      *
91      * @see Parameter
92      *
93      * @return an array of Parameter, one element per argument
94      * in the order the arguments are present.
95      */
96     @Used
parameters()97     Parameter[] parameters();
98 
99     /**
100      * Get the receiver type of this executable element.
101      *
102      * @return the receiver type of this executable element.
103      * @since 1.8
104      */
105     @Unused
receiverType()106     Type receiverType();
107 
108     /**
109      * Return the throws tags in this method.
110      *
111      * @return an array of ThrowTag containing all <code>&#64;exception</code>
112      * and <code>&#64;throws</code> tags.
113      */
114     @Unused
throwsTags()115     ThrowsTag[] throwsTags();
116 
117     /**
118      * Return the param tags in this method, excluding the type
119      * parameter tags.
120      *
121      * @return an array of ParamTag containing all <code>&#64;param</code> tags
122      * corresponding to the parameters of this method.
123      */
124     @Unused
paramTags()125     ParamTag[] paramTags();
126 
127     /**
128      * Return the type parameter tags in this method.
129      *
130      * @return an array of ParamTag containing all <code>&#64;param</code> tags
131      * corresponding to the type parameters of this method.
132      * @since 1.5
133      */
134     @Unused
typeParamTags()135     ParamTag[] typeParamTags();
136 
137     /**
138      * Get the signature. It is the parameter list, type is qualified.
139      *      For instance, for a method <code>mymethod(String x, int y)</code>,
140      *      it will return <code>(java.lang.String,int)</code>.
141      */
142     @Used
signature()143     String signature();
144 
145     /**
146      * get flat signature.  all types are not qualified.
147      *      return a String, which is the flat signiture of this member.
148      *      It is the parameter list, type is not qualified.
149      *      For instance, for a method <code>mymethod(String x, int y)</code>,
150      *      it will return <code>(String, int)</code>.
151      */
152     @Used
flatSignature()153     String flatSignature();
154 
155     /**
156      * Return the formal type parameters of this method or constructor.
157      * Return an empty array if this method or constructor is not generic.
158      *
159      * @return the formal type parameters of this method or constructor.
160      * @since 1.5
161      */
162     @Used
typeParameters()163     TypeVariable[] typeParameters();
164 }
165