org.aspectj.apache.bcel.classfile
Class Method

java.lang.Object
  extended by org.aspectj.apache.bcel.classfile.Modifiers
      extended by org.aspectj.apache.bcel.classfile.FieldOrMethod
          extended by org.aspectj.apache.bcel.classfile.Method
All Implemented Interfaces:
Node

public final class Method
extends FieldOrMethod

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.


Field Summary
static AnnotationGen[][] NO_PARAMETER_ANNOTATIONS
           
static Method[] NoMethods
           
 
Fields inherited from class org.aspectj.apache.bcel.classfile.FieldOrMethod
attributes, cpool, nameIndex, signatureIndex
 
Fields inherited from class org.aspectj.apache.bcel.classfile.Modifiers
modifiers
 
Constructor Summary
Method(int access_flags, int name_index, int signature_index, Attribute[] attributes, ConstantPool constant_pool)
           
Method(Method c)
          Initialize from another object.
 
Method Summary
 void accept(ClassVisitor v)
           
 AnnotationGen[] getAnnotationsOnParameter(int i)
           
 Type[] getArgumentTypes()
           
 Code getCode()
           
 ExceptionTable getExceptionTable()
           
 LineNumberTable getLineNumberTable()
          Return LineNumberTable of code attribute if any (the call is forwarded to the Code attribute)
 LocalVariableTable getLocalVariableTable()
          Return LocalVariableTable of code attribute if any (the call is forwarded to the Code attribute)
 AnnotationGen[][] getParameterAnnotations()
           
 Type getReturnType()
           
 void setAttributes(Attribute[] attributes)
           
 java.lang.String toString()
          Return string representation close to declaration format, eg: 'public static void main(String[] args) throws IOException'
 
Methods inherited from class org.aspectj.apache.bcel.classfile.FieldOrMethod
dump, getAnnotations, getAttributes, getConstantPool, getDeclaredSignature, getGenericSignature, getName, getNameIndex, getSignature, getSignatureIndex
 
Methods inherited from class org.aspectj.apache.bcel.classfile.Modifiers
getModifiers, isAbstract, isBridge, isFinal, isInterface, isNative, isPrivate, isProtected, isPublic, isStatic, isStrictfp, isSynchronized, isTransient, isVarargs, isVolatile, setModifiers
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NO_PARAMETER_ANNOTATIONS

public static final AnnotationGen[][] NO_PARAMETER_ANNOTATIONS

NoMethods

public static final Method[] NoMethods
Constructor Detail

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.


Method

public Method(int access_flags,
              int name_index,
              int signature_index,
              Attribute[] attributes,
              ConstantPool constant_pool)
Method Detail

accept

public void accept(ClassVisitor v)

setAttributes

public void setAttributes(Attribute[] attributes)
Overrides:
setAttributes in class FieldOrMethod
Parameters:
attributes - Collection of object attributes.

getCode

public final Code getCode()
Returns:
Code attribute of method, if any

getExceptionTable

public final ExceptionTable getExceptionTable()

getLocalVariableTable

public final LocalVariableTable getLocalVariableTable()
Return LocalVariableTable of code attribute if any (the call is forwarded to the Code attribute)


getLineNumberTable

public final LineNumberTable getLineNumberTable()
Return LineNumberTable of code attribute if any (the call is forwarded to the Code attribute)


toString

public final java.lang.String toString()
Return string representation close to declaration format, eg: 'public static void main(String[] args) throws IOException'

Overrides:
toString in class java.lang.Object

getReturnType

public Type getReturnType()
Returns:
return type of method

getArgumentTypes

public Type[] getArgumentTypes()
Returns:
array of method argument types

getAnnotationsOnParameter

public AnnotationGen[] getAnnotationsOnParameter(int i)

getParameterAnnotations

public AnnotationGen[][] getParameterAnnotations()