KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > sli > kim > classfile > FieldInfo


1 package sli.kim.classfile;
2
3 /**
4 * A class for storing information about fields.
5 *
6 * @see ClassInfo#addField()
7 */

8 public class FieldInfo extends CommonInfo {
9     private String JavaDoc signature;
10     private Object JavaDoc constValue;
11     private boolean synthetic;
12
13     public FieldInfo(short accessFlags, String JavaDoc name, String JavaDoc signature) {
14         setAccessFlags(accessFlags);
15         setName(name);
16         setSignature(signature);
17     }
18
19     /**
20     * Set the signature of the field. For example "[Ljava/lang/String;"
21     *
22     * @see Signature
23     */

24     public void setSignature(String JavaDoc signature) {
25         this.signature = signature;
26     }
27
28     /**
29     * Get the signature of the field.
30     *
31     * @see Signature
32     */

33     public String JavaDoc getSignature() {
34         return signature;
35     }
36
37     /**
38     * Set the constant value of this field. This only applies to final fields.
39     * The value must be a String, Integer, Long, Float, or Double.
40     */

41     public void setConstantValue(Object JavaDoc constValue) {
42         this.constValue = constValue;
43     }
44
45     /**
46     * Get the constant value of this field. The result must be a String,
47     * Integer, Long, Float, or Double.
48     */

49     public Object JavaDoc getConstantValue() {
50         return constValue;
51     }
52
53     public void setSynthetic(boolean synthetic) {
54         this.synthetic = synthetic;
55     }
56
57     public boolean isSynthetic() {
58         return synthetic;
59     }
60 }
61
Popular Tags