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

Constructor Index

 o FieldGen(Field, ConstantPoolGen)
 o FieldGen(int, Type, String, ConstantPoolGen)
Declare a field.

Method Index

 o addAttribute(Attribute)
Add an attribute to this method.
 o getAttributes()
 o getConstantPool()
 o getField()
Get method object.
 o getName()
 o getSignature()
 o getType()
 o removeAttribute(Attribute)
Remove an attribute.
 o setConstantPool(ConstantPoolGen)
 o setInitValue(boolean)
 o setInitValue(byte)
 o setInitValue(char)
 o setInitValue(double)
 o setInitValue(float)
 o setInitValue(int)
 o setInitValue(long)
 o setInitValue(short)
 o setInitValue(String)
Set (optional) initial value of field, otherwise it will be set to null/0/false by the JVM automatically.
 o setName(String)
 o setType(Type)

Constructors

 o 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
 o FieldGen
 public FieldGen(Field field,
                 ConstantPoolGen cp)

Methods

 o 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.

 o setInitValue
 public void setInitValue(long l)
 o setInitValue
 public void setInitValue(int i)
 o setInitValue
 public void setInitValue(short s)
 o setInitValue
 public void setInitValue(char c)
 o setInitValue
 public void setInitValue(byte b)
 o setInitValue
 public void setInitValue(boolean b)
 o setInitValue
 public void setInitValue(float f)
 o setInitValue
 public void setInitValue(double d)
 o 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
 o getAttributes
 public Attribute[] getAttributes()
Returns:
all attributes of this field.
 o removeAttribute
 public void removeAttribute(Attribute a)
Remove an attribute.

 o getField
 public Field getField()
Get method object.

 o setType
 public void setType(Type type)
 o getType
 public Type getType()
 o setName
 public void setName(String name)
 o getName
 public String getName()
 o getSignature
 public String getSignature()
 o getConstantPool
 public ConstantPoolGen getConstantPool()
 o setConstantPool
 public void setConstantPool(ConstantPoolGen cp)

All Packages  Class Hierarchy  This Package  Previous  Next  Index