org.apache.bcel.generic

Class FieldGenOrMethodGen

Implemented Interfaces:
Cloneable, NamedAndTyped, java.io.Serializable
Known Direct Subclasses:
FieldGen, MethodGen

public abstract class FieldGenOrMethodGen
extends AccessFlags
implements NamedAndTyped, Cloneable

Super class for FieldGen and MethodGen objects, since they have some methods in common!
Version:
$Id: FieldGenOrMethodGen.java,v 1.2 2002/04/24 08:01:36 mdahm Exp $
Author:
M. Dahm
See Also:
Serialized Form

Field Summary

protected ConstantPoolGen
cp
protected String
name
protected Type
type

Fields inherited from class org.apache.bcel.classfile.AccessFlags

access_flags

Constructor Summary

FieldGenOrMethodGen()

Method Summary

void
addAttribute(Attribute a)
Add an attribute to this method.
Object
clone()
Attribute[]
getAttributes()
ConstantPoolGen
getConstantPool()
String
getName()
abstract String
getSignature()
Type
getType()
void
removeAttribute(Attribute a)
Remove an attribute.
void
removeAttributes()
Remove all attributes.
void
setConstantPool(ConstantPoolGen cp)
void
setName(String name)
void
setType(Type type)

Methods inherited from class org.apache.bcel.classfile.AccessFlags

getAccessFlags, getModifiers, isAbstract, isAbstract, isFinal, isFinal, isInterface, isInterface, isNative, isNative, isPrivate, isPrivate, isProtected, isProtected, isPublic, isPublic, isStatic, isStatic, isStrictfp, isStrictfp, isSynchronized, isSynchronized, isTransient, isTransient, isVolatile, isVolatile, setAccessFlags, setModifiers

Field Details

cp

protected ConstantPoolGen cp

name

protected String name

type

protected Type type

Constructor Details

FieldGenOrMethodGen

protected FieldGenOrMethodGen()

Method Details

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()
Specified by:
getName in interface NamedAndTyped
Returns:
name of method/field.

getSignature

public abstract String getSignature()
Returns:
signature of method/field.

getType

public Type getType()
Specified by:
getType in interface NamedAndTyped

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)
Specified by:
setName in interface NamedAndTyped

setType

public void setType(Type type)
Specified by:
setType in interface NamedAndTyped