Package org.apache.bcel.generic
Class FieldGenOrMethodGen
- java.lang.Object
-
- org.apache.bcel.classfile.AccessFlags
-
- org.apache.bcel.generic.FieldGenOrMethodGen
-
- All Implemented Interfaces:
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!
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.List<AnnotationEntryGen>
annotationList
private java.util.List<Attribute>
attributeList
protected ConstantPoolGen
cp
Deprecated.(since 6.0) will be made private; do not access directly, use getter/setterprotected java.lang.String
name
Deprecated.(since 6.0) will be made private; do not access directly, use getter/setterprotected Type
type
Deprecated.(since 6.0) will be made private; do not access directly, use getter/setter-
Fields inherited from class org.apache.bcel.classfile.AccessFlags
access_flags
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
FieldGenOrMethodGen()
protected
FieldGenOrMethodGen(int accessFlags)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected void
addAll(Attribute[] attrs)
void
addAnnotationEntry(AnnotationEntryGen ag)
void
addAttribute(Attribute a)
Add an attribute to this method.java.lang.Object
clone()
AnnotationEntryGen[]
getAnnotationEntries()
Attribute[]
getAttributes()
ConstantPoolGen
getConstantPool()
java.lang.String
getName()
abstract java.lang.String
getSignature()
Type
getType()
void
removeAnnotationEntries()
void
removeAnnotationEntry(AnnotationEntryGen ag)
void
removeAttribute(Attribute a)
Remove an attribute.void
removeAttributes()
Remove all attributes.void
setConstantPool(ConstantPoolGen cp)
void
setName(java.lang.String name)
void
setType(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, isVarArgs, isVarArgs, isVolatile, isVolatile, setAccessFlags, setModifiers
-
-
-
-
Field Detail
-
name
@Deprecated protected java.lang.String name
Deprecated.(since 6.0) will be made private; do not access directly, use getter/setter
-
type
@Deprecated protected Type type
Deprecated.(since 6.0) will be made private; do not access directly, use getter/setter
-
cp
@Deprecated protected ConstantPoolGen cp
Deprecated.(since 6.0) will be made private; do not access directly, use getter/setter
-
attributeList
private final java.util.List<Attribute> attributeList
-
annotationList
private final java.util.List<AnnotationEntryGen> annotationList
-
-
Method Detail
-
addAll
protected void addAll(Attribute[] attrs)
-
addAnnotationEntry
public void addAnnotationEntry(AnnotationEntryGen ag)
- Since:
- 6.0
-
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 java.lang.Object clone()
- Overrides:
clone
in classjava.lang.Object
-
getAnnotationEntries
public AnnotationEntryGen[] getAnnotationEntries()
-
getAttributes
public Attribute[] getAttributes()
- Returns:
- all attributes of this method.
-
getConstantPool
public ConstantPoolGen getConstantPool()
-
getName
public java.lang.String getName()
- Specified by:
getName
in interfaceNamedAndTyped
- Returns:
- name of method/field.
-
getSignature
public abstract java.lang.String getSignature()
- Returns:
- signature of method/field.
-
getType
public Type getType()
- Specified by:
getType
in interfaceNamedAndTyped
-
removeAnnotationEntries
public void removeAnnotationEntries()
- Since:
- 6.0
-
removeAnnotationEntry
public void removeAnnotationEntry(AnnotationEntryGen ag)
- Since:
- 6.0
-
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(java.lang.String name)
- Specified by:
setName
in interfaceNamedAndTyped
-
setType
public void setType(Type type)
- Specified by:
setType
in interfaceNamedAndTyped
-
-