org.aspectj.apache.bcel.generic
Class FieldGen
java.lang.Object
org.aspectj.apache.bcel.classfile.Modifiers
org.aspectj.apache.bcel.generic.FieldGenOrMethodGen
org.aspectj.apache.bcel.generic.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).
- See Also:
Field
Methods inherited from class org.aspectj.apache.bcel.generic.FieldGenOrMethodGen |
addAnnotation, addAnnotationsAsAttribute, addAttribute, getAnnotations, getAttributes, getAttributesImmutable, getConstantPool, getName, getType, removeAnnotation, removeAnnotations, removeAttribute, removeAttributes, setConstantPool, setName, setType |
Methods inherited from class org.aspectj.apache.bcel.classfile.Modifiers |
getModifiers, isAbstract, isBridge, isFinal, isInterface, isNative, isPrivate, isProtected, isPublic, isStatic, isStrictfp, isSynchronized, isTransient, isVarargs, isVolatile, setModifiers |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
FieldGen
public FieldGen(int modifiers,
Type type,
java.lang.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().
- Parameters:
modifiers
- access qualifierstype
- field typename
- field namecpool
- constant pool
FieldGen
public FieldGen(Field field,
ConstantPool cp)
- Instantiate from existing field.
- Parameters:
field
- Field objectcp
- constant pool (must contain the same entries as the field's constant pool)
setValue
public void setValue(int index)
setValue
public void setValue(java.lang.String constantString)
wipeValue
public void wipeValue()
getField
public Field getField()
- Get field object after having set up all necessary values.
getSignature
public java.lang.String getSignature()
- Specified by:
getSignature
in class FieldGenOrMethodGen
getInitialValue
public java.lang.String getInitialValue()
setInitialStringValue
public void setInitialStringValue(java.lang.String value)
toString
public final java.lang.String toString()
- Return string representation close to declaration format, `public static final short MAX = 100', e.g..
- Overrides:
toString
in class java.lang.Object