Package 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
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).
-
Field Summary
Fields inherited from class org.aspectj.apache.bcel.generic.FieldGenOrMethodGen
annotationList, cp, name, type
-
Constructor Summary
ConstructorDescriptionFieldGen(int modifiers, Type type, String name, ConstantPool cpool)
Declare a field.FieldGen(Field field, ConstantPool cp)
Instantiate from existing field. -
Method Summary
Modifier and TypeMethodDescriptiongetField()
Get field object after having set up all necessary values.void
setInitialStringValue(String value)
void
setValue(int index)
void
toString()
Return string representation close to declaration format, `public static final short MAX = 100', e.g..void
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
-
Constructor Details
-
FieldGen
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
Instantiate from existing field.- Parameters:
field
- Field objectcp
- constant pool (must contain the same entries as the field's constant pool)
-
-
Method Details
-
setValue
public void setValue(int index) -
setValue
-
wipeValue
public void wipeValue() -
getField
Get field object after having set up all necessary values. -
getSignature
- Specified by:
getSignature
in classFieldGenOrMethodGen
-
getInitialValue
-
setInitialStringValue
-
toString
Return string representation close to declaration format, `public static final short MAX = 100', e.g..
-