KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jdt > core > util > IMethodInfo


1 /*******************************************************************************
2  * Copyright (c) 2000, 2006 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.jdt.core.util;
12
13 /**
14  * Description of a method info as described in the JVM
15  * specifications.
16  *
17  * This interface may be implemented by clients.
18  *
19  * @since 2.0
20  */

21 public interface IMethodInfo {
22
23     /**
24      * Answer back the method descriptor of this method info as specified
25      * in the JVM specifications.
26      *
27      * @return the method descriptor of this method info as specified
28      * in the JVM specifications
29      */

30     char[] getDescriptor();
31
32     /**
33      * Answer back the descriptor index of this method info.
34      *
35      * @return the descriptor index of this method info
36      */

37     int getDescriptorIndex();
38
39     /**
40      * Answer back the access flags of this method info as specified
41      * in the JVM specifications.
42      *
43      * @return the access flags of this method info as specified
44      * in the JVM specifications
45      */

46     int getAccessFlags();
47
48     /**
49      * Answer back the name of this method info as specified
50      * in the JVM specifications.
51      *
52      * @return the name of this method info as specified
53      * in the JVM specifications
54      */

55     char[] getName();
56
57     /**
58      * Answer back the name index of this method info.
59      *
60      * @return the name index of this method info
61      */

62     int getNameIndex();
63     
64     /**
65      * Answer true if this method info represents a <clinit> method,
66      * false otherwise.
67      *
68      * @return true if this method info represents a <clinit> method,
69      * false otherwise
70      */

71     boolean isClinit();
72
73     /**
74      * Answer true if this method info represents a constructor,
75      * false otherwise.
76      *
77      * @return true if this method info represents a constructor,
78      * false otherwise
79      */

80     boolean isConstructor();
81
82     /**
83      * Return true if the method info is synthetic according to the JVM specification, false otherwise.
84      * <p>Note that prior to JDK 1.5, synthetic fields were always marked using
85      * an attribute; with 1.5, synthetic fields can also be marked using
86      * the {@link IModifierConstants#ACC_SYNTHETIC} flag.
87      * </p>
88      *
89      * @return true if the method info is synthetic according to the JVM specification, false otherwise
90      */

91     boolean isSynthetic();
92
93     /**
94      * Answer true if this method info has a deprecated attribute,
95      * false otherwise.
96      *
97      * @return true if this method info has a deprecated attribute,
98      * false otherwise
99      */

100     boolean isDeprecated();
101
102     /**
103      * Answer the code attribute of this method info, null if none or if the decoding
104      * flag doesn't include METHOD_BODIES.
105      *
106      * @return the code attribute of this method info, null if none or if the decoding
107      * flag doesn't include METHOD_BODIES
108      */

109     ICodeAttribute getCodeAttribute();
110     
111     /**
112      * Answer the exception attribute of this method info, null is none.
113      *
114      * @return the exception attribute of this method info, null is none
115      */

116     IExceptionAttribute getExceptionAttribute();
117
118     /**
119      * Answer back the attribute number of the method info. It includes the CodeAttribute
120      * if any even if the decoding flags doesn't include METHOD_BODIES.
121      *
122      * @return the attribute number of the method info. It includes the CodeAttribute
123      * if any even if the decoding flags doesn't include METHOD_BODIES
124      */

125     int getAttributeCount();
126     
127     /**
128      * Answer back the collection of all attributes of the method info. It
129      * includes SyntheticAttribute, CodeAttributes, etc. It doesn't include the
130      * CodeAttribute if the decoding flags doesn't include METHOD_BODIES.
131      * Returns an empty collection if none.
132      *
133      * @return the collection of all attributes of the method info. It
134      * includes SyntheticAttribute, CodeAttributes, etc. It doesn't include the
135      * CodeAttribute if the decoding flags doesn't include METHOD_BODIES.
136      * Returns an empty collection if none
137      */

138     IClassFileAttribute[] getAttributes();
139 }
140
Popular Tags