KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jdt > core > IField


1 /*******************************************************************************
2  * Copyright (c) 2000, 2005 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  * IBM Corporation - added J2SE 1.5 support
11  *******************************************************************************/

12 package org.eclipse.jdt.core;
13
14 /**
15  * Represents a field declared in a type.
16  * <p>
17  * This interface is not intended to be implemented by clients.
18  * </p>
19  */

20 public interface IField extends IMember {
21 /**
22  * Returns the constant value associated with this field
23  * or <code>null</code> if this field has none. The field needs to be static and final to have
24  * a constant value.
25  * Returns an instance of the wrapper type corresponding to the the type of the field.
26  * <table border="1">
27  * <tr>
28  * <th>field type</th>
29  * <th>wrapper type</th>
30  * </tr>
31  * <tr>
32  * <td>int
33  * </td>
34  * <td>java.lang.Integer
35  * </td>
36  * </tr>
37  * <tr>
38  * <td>byte
39  * </td>
40  * <td>java.lang.Byte
41  * </td>
42  * </tr>
43  * <tr>
44  * <td>boolean
45  * </td>
46  * <td>java.lang.Boolean
47  * </td>
48  * </tr>
49  * <tr>
50  * <td>char
51  * </td>
52  * <td>java.lang.Character
53  * </td>
54  * </tr>
55  * <tr>
56  * <td>double
57  * </td>
58  * <td>java.lang.Double
59  * </td>
60  * </tr>
61  * <tr>
62  * <td>float
63  * </td>
64  * <td>java.lang.Float
65  * </td>
66  * </tr>
67  * <tr>
68  * <td>long
69  * </td>
70  * <td>java.lang.Long
71  * </td>
72  * </tr>
73  * <tr>
74  * <td>short
75  * </td>
76  * <td>java.lang.Short
77  * </td>
78  * </tr>
79  * <tr>
80  * <td>java.lang.String
81  * </td>
82  * <td>java.lang.String
83  * </td>
84  * </tr>
85  * </table>
86  *
87  * @return the constant value associated with this field or <code>null</code> if this field has none.
88  * @exception JavaModelException if this element does not exist or if an
89  * exception occurs while accessing its corresponding resource
90  */

91 public Object JavaDoc getConstant() throws JavaModelException;
92 /**
93  * Returns the simple name of this field.
94  * @return the simple name of this field.
95  */

96 String JavaDoc getElementName();
97 /**
98  * Returns the binding key for this field. A binding key is a key that uniquely
99  * identifies this field. It allows access to generic info for parameterized
100  * fields.
101  *
102  * @return the binding key for this field
103  * @see org.eclipse.jdt.core.dom.IBinding#getKey()
104  * @see BindingKey
105  * @since 3.1
106  */

107 String JavaDoc getKey();
108 /**
109  * Returns the type signature of this field. For enum constants,
110  * this returns the signature of the declaring enum class.
111  * <p>
112  * The type signature may be either unresolved (for source types)
113  * or resolved (for binary types), and either basic (for basic types)
114  * or rich (for parameterized types). See {@link Signature} for details.
115  * </p>
116  *
117  * @return the type signature of this field
118  * @exception JavaModelException if this element does not exist or if an
119  * exception occurs while accessing its corresponding resource
120  * @see Signature
121  */

122 String JavaDoc getTypeSignature() throws JavaModelException;
123 /**
124  * Returns whether this field represents an enum constant.
125  *
126  * @return whether this field represents an enum constant
127  * @exception JavaModelException if this element does not exist or if an
128  * exception occurs while accessing its corresponding resource
129  * @since 3.1
130  */

131 boolean isEnumConstant() throws JavaModelException;
132 /**
133  * Returns whether this field represents a resolved field.
134  * If a field is resoved, its key contains resolved information.
135  *
136  * @return whether this field represents a resolved field.
137  * @since 3.1
138  */

139 boolean isResolved();
140
141 }
142
Popular Tags