|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.bcel.classfile.AccessFlags org.apache.bcel.generic.FieldGenOrMethodGen org.apache.bcel.generic.FieldGen
public class FieldGen
Template class for building up a field. The only extraordinary thing one can do is to add a constant value attribute to a field (which must of course be compatible with to the declared type).
Field
,
Serialized FormField Summary |
---|
Fields inherited from class org.apache.bcel.generic.FieldGenOrMethodGen |
---|
cp, name, type |
Fields inherited from class org.apache.bcel.classfile.AccessFlags |
---|
access_flags |
Constructor Summary | |
---|---|
FieldGen(Field field,
ConstantPoolGen cp)
Instantiate from existing field. |
|
FieldGen(int access_flags,
Type type,
String name,
ConstantPoolGen cp)
Declare a field. |
Method Summary | |
---|---|
void |
addObserver(FieldObserver o)
Add observer for this object. |
void |
cancelInitValue()
Remove any initial value. |
FieldGen |
copy(ConstantPoolGen cp)
|
boolean |
equals(Object obj)
Return value as defined by given BCELComparator strategy. |
static BCELComparator |
getComparator()
|
Field |
getField()
Get field object after having set up all necessary values. |
String |
getInitValue()
|
String |
getSignature()
|
int |
hashCode()
Return value as defined by given BCELComparator strategy. |
void |
removeObserver(FieldObserver o)
Remove observer for this object. |
static void |
setComparator(BCELComparator comparator)
|
void |
setInitValue(boolean b)
|
void |
setInitValue(byte b)
|
void |
setInitValue(char c)
|
void |
setInitValue(double d)
|
void |
setInitValue(float f)
|
void |
setInitValue(int i)
|
void |
setInitValue(long l)
|
void |
setInitValue(short s)
|
void |
setInitValue(String str)
Set (optional) initial value of field, otherwise it will be set to null/0/false by the JVM automatically. |
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. |
Methods inherited from class org.apache.bcel.generic.FieldGenOrMethodGen |
---|
addAttribute, clone, getAttributes, getConstantPool, getName, getType, removeAttribute, removeAttributes, setConstantPool, setName, setType |
Methods inherited from class org.apache.bcel.classfile.AccessFlags |
---|
getAccessFlags, getModifiers, isAbstract, isAbstract, isAnnotation, isAnnotation, isEnum, isEnum, isFinal, isFinal, isInterface, isInterface, isNative, isNative, isPrivate, isPrivate, isProtected, isProtected, isPublic, isPublic, isStatic, isStatic, isStrictfp, isStrictfp, isSynchronized, isSynchronized, isSynthetic, isSynthetic, isTransient, isTransient, isVolatile, isVolatile, setAccessFlags, setModifiers |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public FieldGen(int access_flags, Type type, String name, ConstantPoolGen cp)
access_flags
- access qualifierstype
- field typename
- field namecp
- constant poolpublic FieldGen(Field field, ConstantPoolGen cp)
field
- Field objectcp
- constant pool (must contain the same entries as the field's constant pool)Method Detail |
---|
public void setInitValue(String str)
public void setInitValue(long l)
public void setInitValue(int i)
public void setInitValue(short s)
public void setInitValue(char c)
public void setInitValue(byte b)
public void setInitValue(boolean b)
public void setInitValue(float f)
public void setInitValue(double d)
public void cancelInitValue()
public Field getField()
public String getSignature()
getSignature
in class FieldGenOrMethodGen
public void addObserver(FieldObserver o)
public void removeObserver(FieldObserver o)
public void update()
public String getInitValue()
public final String toString()
toString
in class Object
public FieldGen copy(ConstantPoolGen cp)
public static BCELComparator getComparator()
public static void setComparator(BCELComparator comparator)
comparator
- Comparison strategy objectpublic boolean equals(Object obj)
equals
in class Object
Object.equals(java.lang.Object)
public int hashCode()
hashCode
in class Object
Object.hashCode()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |