Klasse FieldGen


public class FieldGen extends FieldGenOrMethodGen
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 the declared type).
Version:
$Id: FieldGen.java,v 1.11 2011/10/03 22:41:24 aclement Exp $
Autor:
M. Dahm
Siehe auch:
  • Konstruktordetails

    • FieldGen

      public FieldGen(int modifiers, Type type, String name, ConstantPool cpool)
      Declare a field. If it is static (isStatic() == true) and has a basic type like int or String it may have an initial value associated with it as defined by setInitValue().
      Parameter:
      modifiers - access qualifiers
      type - field type
      name - field name
      cpool - constant pool
    • FieldGen

      public FieldGen(Field field, ConstantPool cp)
      Instantiate from existing field.
      Parameter:
      field - Field object
      cp - constant pool (must contain the same entries as the field's constant pool)
  • Methodendetails

    • setValue

      public void setValue(int index)
    • setValue

      public void setValue(String constantString)
    • wipeValue

      public void wipeValue()
    • getField

      public Field getField()
      Get field object after having set up all necessary values.
    • getSignature

      public String getSignature()
      Angegeben von:
      getSignature in Klasse FieldGenOrMethodGen
    • getInitialValue

      public String getInitialValue()
    • setInitialStringValue

      public void setInitialStringValue(String value)
    • toString

      public final String toString()
      Return string representation close to declaration format, `public static final short MAX = 100', e.g..
      Setzt außer Kraft:
      toString in Klasse Object