Package org.apache.bcel.generic
Class FieldGenOrMethodGen
- java.lang.Object
-
- org.apache.bcel.classfile.AccessFlags
-
- org.apache.bcel.generic.FieldGenOrMethodGen
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable,NamedAndTyped
public abstract class FieldGenOrMethodGen extends AccessFlags implements NamedAndTyped, java.lang.Cloneable
Super class for FieldGen and MethodGen objects, since they have some methods in common!- Version:
- $Id: FieldGenOrMethodGen.java 420672 2006-07-11 01:57:19Z tcurdt $
- Author:
- M. Dahm
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.ArrayListannotation_vecprotected ConstantPoolGencpprotected java.lang.Stringnameprotected Typetype-
Fields inherited from class org.apache.bcel.classfile.AccessFlags
access_flags
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedFieldGenOrMethodGen()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidaddAnnotationEntry(AnnotationEntryGen ag)voidaddAttribute(Attribute a)Add an attribute to this method.java.lang.Objectclone()AnnotationEntryGen[]getAnnotationEntries()Attribute[]getAttributes()ConstantPoolGengetConstantPool()java.lang.StringgetName()abstract java.lang.StringgetSignature()TypegetType()voidremoveAnnotationEntries()voidremoveAnnotationEntry(AnnotationEntryGen ag)voidremoveAttribute(Attribute a)Remove an attribute.voidremoveAttributes()Remove all attributes.voidsetConstantPool(ConstantPoolGen cp)voidsetName(java.lang.String name)voidsetType(Type type)-
Methods inherited from class org.apache.bcel.classfile.AccessFlags
getAccessFlags, getModifiers, isAbstract, isAbstract, isAnnotation, isAnnotation, isEnum, isEnum, isFinal, isFinal, isInterface, isInterface, isNative, isNative, isPrivate, isPrivate, isProtected, isProtected, isPublic, isPublic, isStatic, isStatic, isStrictfp, isStrictfp, isSynchronized, isSynchronized, isSynthetic, isSynthetic, isTransient, isTransient, isVolatile, isVolatile, setAccessFlags, setModifiers
-
-
-
-
Field Detail
-
name
protected java.lang.String name
-
type
protected Type type
-
cp
protected ConstantPoolGen cp
-
annotation_vec
protected java.util.ArrayList annotation_vec
-
-
Method Detail
-
setType
public void setType(Type type)
- Specified by:
setTypein interfaceNamedAndTyped
-
getType
public Type getType()
- Specified by:
getTypein interfaceNamedAndTyped
-
getName
public java.lang.String getName()
- Specified by:
getNamein interfaceNamedAndTyped- Returns:
- name of method/field.
-
setName
public void setName(java.lang.String name)
- Specified by:
setNamein interfaceNamedAndTyped
-
getConstantPool
public ConstantPoolGen getConstantPool()
-
setConstantPool
public void setConstantPool(ConstantPoolGen cp)
-
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
-
addAnnotationEntry
public void addAnnotationEntry(AnnotationEntryGen ag)
-
removeAttribute
public void removeAttribute(Attribute a)
Remove an attribute.
-
removeAnnotationEntry
public void removeAnnotationEntry(AnnotationEntryGen ag)
-
removeAttributes
public void removeAttributes()
Remove all attributes.
-
removeAnnotationEntries
public void removeAnnotationEntries()
-
getAttributes
public Attribute[] getAttributes()
- Returns:
- all attributes of this method.
-
getAnnotationEntries
public AnnotationEntryGen[] getAnnotationEntries()
-
getSignature
public abstract java.lang.String getSignature()
- Returns:
- signature of method/field.
-
clone
public java.lang.Object clone()
- Overrides:
clonein classjava.lang.Object
-
-