org.apache.bcel.classfile
Class Method
- Cloneable, Node, java.io.Serializable
public final class Method
This class represents the method info structure, i.e., the representation
for a method in the class. See JVM specification for details.
A method has access flags, a name, a signature and a number of attributes.
Version:
- M. Dahm
- Serialized Form
Method() - Empty constructor, all attributes have to be defined via `setXXX'
methods.
|
Method(int access_flags, int name_index, int signature_index, Attribute attributes, ConstantPool constant_pool)
|
Method(Method c) - Initialize from another object.
|
copy_ , dump , getAttributes , getConstantPool , getName , getNameIndex , getSignature , getSignatureIndex , setAttributes , setConstantPool , setNameIndex , setSignatureIndex |
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 |
Method
public Method()
Empty constructor, all attributes have to be defined via `setXXX'
methods. Use at your own risk.
Method
public Method(int access_flags,
int name_index,
int signature_index,
Attribute attributes,
ConstantPool constant_pool)
access_flags
- Access rights of methodname_index
- Points to field name in constant poolsignature_index
- Points to encoded signatureattributes
- Collection of attributesconstant_pool
- Array of constants
Method
public Method(Method c)
Initialize from another object. Note that both objects use the same
references (shallow copy). Use clone() for a physical copy.
accept
public void accept(Visitor v)
Called by objects that are traversing the nodes of the tree implicitely
defined by the contents of a Java class. I.e., the hierarchy of methods,
fields, attributes, etc. spawns a tree of objects.
- accept in interface Node
v
- Visitor object
getArgumentTypes
public Type[] getArgumentTypes()
- array of method argument types
getCode
public final Code getCode()
- Code attribute of method, if any
getExceptionTable
public final ExceptionTable getExceptionTable()
- ExceptionTable attribute of method, if any, i.e., list all
exceptions the method may throw not exception handlers!
getLineNumberTable
public final LineNumberTable getLineNumberTable()
- LineNumberTable of code attribute if any, i.e. the call is forwarded
to the Code atribute.
getLocalVariableTable
public final LocalVariableTable getLocalVariableTable()
- LocalVariableTable of code attribute if any, i.e. the call is forwarded
to the Code atribute.
getReturnType
public Type getReturnType()
- return type of method
toString
public final String toString()
Return string representation close to declaration format,
`public static void main(String[] args) throws IOException', e.g.
- String representation of the method.