org.apache.bcel.generic

Class FieldGenOrMethodGen

public abstract class FieldGenOrMethodGen extends AccessFlags implements NamedAndTyped, Cloneable

Super class for FieldGen and MethodGen objects, since they have some methods in common!
Field Summary
protected ConstantPoolGencp
protected Stringname
protected Typetype
Constructor Summary
protected FieldGenOrMethodGen()
Method Summary
voidaddAttribute(Attribute a)
Add an attribute to this method.
Objectclone()
Attribute[]getAttributes()
ConstantPoolGengetConstantPool()
StringgetName()
abstract StringgetSignature()
TypegetType()
voidremoveAttribute(Attribute a)
Remove an attribute.
voidremoveAttributes()
Remove all attributes.
voidsetConstantPool(ConstantPoolGen cp)
voidsetName(String name)
voidsetType(Type type)

Field Detail

cp

protected ConstantPoolGen cp

name

protected String name

type

protected Type type

Constructor Detail

FieldGenOrMethodGen

protected FieldGenOrMethodGen()

Method Detail

addAttribute

public void addAttribute(Attribute a)
Add an attribute to this method. Currently, the JVM knows about the `Code', `ConstantValue', `Synthetic' and `Exceptions' attributes. Other attributes will be ignored by the JVM but do no harm.

Parameters: a attribute to be added

clone

public Object clone()

getAttributes

public Attribute[] getAttributes()

Returns: all attributes of this method.

getConstantPool

public ConstantPoolGen getConstantPool()

getName

public String getName()

Returns: name of method/field.

getSignature

public abstract String getSignature()

Returns: signature of method/field.

getType

public Type getType()

removeAttribute

public void removeAttribute(Attribute a)
Remove an attribute.

removeAttributes

public void removeAttributes()
Remove all attributes.

setConstantPool

public void setConstantPool(ConstantPoolGen cp)

setName

public void setName(String name)

setType

public void setType(Type type)