Class FieldGenOrMethodGen
java.lang.Object
org.apache.bcel.classfile.AccessFlags
org.apache.bcel.generic.FieldGenOrMethodGen
- All Implemented Interfaces:
Cloneable, NamedAndTyped
Superclass 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_flagsModifier and TypeFieldDescriptionprotected intDeprecated.(since 6.0) will be made private; do not access directly, use getter/setter. -
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 of the method or field.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, setModifiersModifier and TypeMethodDescriptionfinal intGets access flags.final intGets access flags.final booleanTests whether the abstract bit is on.final voidisAbstract(boolean flag) Sets the abstract bit.final booleanTests whether the annotation bit is on.final voidisAnnotation(boolean flag) Sets the annotation bit.final booleanisEnum()Tests whether the enum bit is on.final voidisEnum(boolean flag) Sets the enum bit.final booleanisFinal()Tests whether the final bit is on.final voidisFinal(boolean flag) Sets the final bit.final booleanTests whether the interface bit is on.final voidisInterface(boolean flag) Sets the interface bit.final booleanisNative()Tests whether the native bit is on.final voidisNative(boolean flag) Sets the native bit.final booleanTests whether the private bit is on.final voidisPrivate(boolean flag) Sets the private bit.final booleanTests whether the protected bit is on.final voidisProtected(boolean flag) Sets the protected bit.final booleanisPublic()Tests whether the public bit is on.final voidisPublic(boolean flag) Sets the public bit.final booleanisStatic()Tests whether the static bit is on.final voidisStatic(boolean flag) Sets the static bit.final booleanTests whether the strict bit is on.final voidisStrictfp(boolean flag) Sets the strict bit.final booleanTests whether the synchronized bit is on.final voidisSynchronized(boolean flag) Sets the synchronized bit.final booleanTests whether the synthetic bit is on.final voidisSynthetic(boolean flag) Sets the synthetic bit.final booleanTests whether the transient bit is on.final voidisTransient(boolean flag) Sets the transient bit.final booleanTests whether the varargs bit is on.final voidisVarArgs(boolean flag) Sets the varargs bit.final booleanTests whether the volatile bit is on.final voidisVolatile(boolean flag) Sets the volatile bit.final voidsetAccessFlags(int accessFlags) Sets access flags also known as modifiers.final voidsetModifiers(int accessFlags) Sets access flags aka "modifiers".
-
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
Gets the name of the method or field.- 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.
-