All Packages Class Hierarchy This Package Previous Next Index
Class de.fub.bytecode.generic.FieldGen
java.lang.Object
|
+----de.fub.bytecode.classfile.AccessFlags
|
+----de.fub.bytecode.generic.FieldGen
- public class FieldGen
- extends AccessFlags
- implements Constants
Template class for building up a field. The only reasonable thing
one can do is a constant value attribute to a field which must of
course be compatible with to the declared type.
- Version:
- $Id: FieldGen.java,v 1.10 2000/02/04 08:58:35 dahm Exp $
- Author:
- M. Dahm
- See Also:
- Field
-
FieldGen(Field, ConstantPoolGen)
-
-
FieldGen(int, Type, String, ConstantPoolGen)
- Declare a field.
-
addAttribute(Attribute)
- Add an attribute to this method.
-
getAttributes()
-
-
getConstantPool()
-
-
getField()
- Get method object.
-
getName()
-
-
getSignature()
-
-
getType()
-
-
removeAttribute(Attribute)
- Remove an attribute.
-
setConstantPool(ConstantPoolGen)
-
-
setInitValue(boolean)
-
-
setInitValue(byte)
-
-
setInitValue(char)
-
-
setInitValue(double)
-
-
setInitValue(float)
-
-
setInitValue(int)
-
-
setInitValue(long)
-
-
setInitValue(short)
-
-
setInitValue(String)
- Set (optional) initial value of field, otherwise it will be set to null/0/false
by the JVM automatically.
-
setName(String)
-
-
setType(Type)
-
FieldGen
public FieldGen(int access_flags,
Type type,
String name,
ConstantPoolGen cp)
- Declare a field. If it is a static field (access_flags & ACC_STATIC != 0) it
may have an initial value associated with it as defined by setInitValue().
- Parameters:
- access_flags - access qualifiers
- type - field type
- name - field name
- cp - constant pool
FieldGen
public FieldGen(Field field,
ConstantPoolGen cp)
setInitValue
public void setInitValue(String str)
- Set (optional) initial value of field, otherwise it will be set to null/0/false
by the JVM automatically.
setInitValue
public void setInitValue(long l)
setInitValue
public void setInitValue(int i)
setInitValue
public void setInitValue(short s)
setInitValue
public void setInitValue(char c)
setInitValue
public void setInitValue(byte b)
setInitValue
public void setInitValue(boolean b)
setInitValue
public void setInitValue(float f)
setInitValue
public void setInitValue(double d)
addAttribute
public void addAttribute(Attribute attr)
- Add an attribute to this method. Currently, the JVM knows about
the `ConstantValue' and `Synthetic' attribute. Other attributes
will be ignored by the JVM but do no harm.
- Parameters:
- a - attribute to be added
getAttributes
public Attribute[] getAttributes()
- Returns:
- all attributes of this field.
removeAttribute
public void removeAttribute(Attribute a)
- Remove an attribute.
getField
public Field getField()
- Get method object.
setType
public void setType(Type type)
getType
public Type getType()
setName
public void setName(String name)
getName
public String getName()
getSignature
public String getSignature()
getConstantPool
public ConstantPoolGen getConstantPool()
setConstantPool
public void setConstantPool(ConstantPoolGen cp)
All Packages Class Hierarchy This Package Previous Next Index