org.apache.bcel.generic
public class FieldGen extends FieldGenOrMethodGen
Version: $Id: FieldGen.java 152690 2001-10-29 19:59:54Z jvanzyl $
See Also: Field
Constructor Summary | |
---|---|
FieldGen(int access_flags, Type type, String name, ConstantPoolGen cp)
Declare a field. | |
FieldGen(Field field, ConstantPoolGen cp)
Instantiate from existing field.
|
Method Summary | |
---|---|
void | addObserver(FieldObserver o) Add observer for this object. |
void | cancelInitValue() Remove any initial value. |
FieldGen | copy(ConstantPoolGen cp) |
Field | getField()
Get field object after having set up all necessary values. |
String | getInitValue() |
String | getSignature() |
void | removeObserver(FieldObserver o) Remove observer for this object. |
void | setInitValue(String str)
Set (optional) initial value of field, otherwise it will be set to null/0/false
by the JVM automatically. |
void | setInitValue(long l) |
void | setInitValue(int i) |
void | setInitValue(short s) |
void | setInitValue(char c) |
void | setInitValue(byte b) |
void | setInitValue(boolean b) |
void | setInitValue(float f) |
void | setInitValue(double d) |
String | toString()
Return string representation close to declaration format,
`public static final short MAX = 100', e.g..
|
void | update() Call notify() method on all observers. |
Parameters: access_flags access qualifiers type field type name field name cp constant pool
Parameters: field Field object cp constant pool (must contain the same entries as the field's constant pool)
Returns: deep copy of this field
Returns: String representation of field