Class FieldGenOrMethodGen
java.lang.Object
org.apache.bcel.classfile.AccessFlags
org.apache.bcel.generic.FieldGenOrMethodGen
- All Implemented Interfaces:
Cloneable, NamedAndTyped
Super class for FieldGen and MethodGen objects, since they have some methods in common!
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ConstantPoolGenDeprecated.(since 6.0) will be made private; do not access directly, use getter/setterprotected StringDeprecated.(since 6.0) will be made private; do not access directly, use getter/setterprotected TypeDeprecated.(since 6.0) will be made private; do not access directly, use getter/setterFields inherited from class AccessFlags
access_flags -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedConstructs a FieldGenOrMethodGen.protectedFieldGenOrMethodGen(int accessFlags) Constructs a FieldGenOrMethodGen. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidAdds all attributes from an array.voidAdds an annotation entry.voidAdd an attribute to this method.clone()Gets all annotation entries.Gets all attributes of this method or field.Gets the constant pool.getName()Gets the name.abstract StringGets the signature of method or field.getType()Gets the type.voidRemoves all annotation entries.voidRemoves an annotation entry.voidRemoves an attribute.voidRemoves all attributes.voidSets the constant pool.voidSets the name.voidSets the type.Methods inherited from class 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 Details
-
name
Deprecated.(since 6.0) will be made private; do not access directly, use getter/setter -
type
Deprecated.(since 6.0) will be made private; do not access directly, use getter/setter -
cp
Deprecated.(since 6.0) will be made private; do not access directly, use getter/setter
-
-
Constructor Details
-
FieldGenOrMethodGen
protected FieldGenOrMethodGen()Constructs a FieldGenOrMethodGen. -
FieldGenOrMethodGen
Constructs a FieldGenOrMethodGen.- Parameters:
accessFlags- the access flags.- Since:
- 6.0
-
-
Method Details
-
addAll
-
addAnnotationEntry
Adds an annotation entry.- Parameters:
ag- the annotation entry.- Since:
- 6.0
-
addAttribute
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
-
getAnnotationEntries
Gets all annotation entries.- Returns:
- all annotation entries.
-
getAttributes
Gets all attributes of this method or field.- Returns:
- all attributes of this method.
-
getConstantPool
-
getName
Description copied from interface:NamedAndTypedGets the name.- Specified by:
getNamein interfaceNamedAndTyped- Returns:
- name of method/field.
-
getSignature
Gets the signature of method or field.- Returns:
- signature of method/field.
-
getType
Description copied from interface:NamedAndTypedGets the type.- Specified by:
getTypein interfaceNamedAndTyped- Returns:
- the type.
-
removeAnnotationEntries
-
removeAnnotationEntry
Removes an annotation entry.- Parameters:
ag- the annotation entry to remove.- Since:
- 6.0
-
removeAttribute
Removes an attribute.- Parameters:
a- the attribute to remove.
-
removeAttributes
Removes all attributes. -
setConstantPool
Sets the constant pool.- Parameters:
cp- the constant pool.
-
setName
Description copied from interface:NamedAndTypedSets the name.- Specified by:
setNamein interfaceNamedAndTyped- Parameters:
name- the name.
-
setType
Description copied from interface:NamedAndTypedSets the type.- Specified by:
setTypein interfaceNamedAndTyped- Parameters:
type- the type.
-