Top Description Fields Constructors Methods
org.aspectj.apache.bcel.classfile

public final Class Method

extends FieldOrMethod
Class Inheritance
Imports
java.io.DataInputStream, .IOException, java.util.ArrayList, .List, org.aspectj.apache.bcel.Constants, org.aspectj.apache.bcel.classfile.annotation.AnnotationGen, .RuntimeInvisParamAnnos, .RuntimeVisParamAnnos, org.aspectj.apache.bcel.generic.Type

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.
Author
M. Dahm
Version
$Id: Method.java,v 1.11 2009/09/15 19:40:12 aclement Exp $

Field Summary

Modifier and TypeField and Description
public static final AnnotationGen[][]
public static final Method[]
private boolean
private AnnotationGen[][]
Inherited from org.aspectj.apache.bcel.classfile.FieldOrMethod:
attributescpoolnameIndexsignatureIndex

Constructor Summary

AccessConstructor and Description
private
public
Method(Method c)

Initialize from another object.

pack-priv
Method(DataInputStream file, ConstantPool constant_pool)

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

Method Summary

Modifier and TypeMethod and Description
public void
private void
public AnnotationGen[]
public Type[]

Returns:

array of method argument types
getArgumentTypes
()

public final Code

Returns:

Code attribute of method, if any
getCode
()

public final ExceptionTable
public final LineNumberTable
getLineNumberTable()

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

public final LocalVariableTable
getLocalVariableTable()

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

public AnnotationGen[][]
public Type

Returns:

return type of method
getReturnType
()

public void
setAttributes(Attribute[]
Collection of object attributes.
attributes
)

Overrides org.aspectj.apache.bcel.classfile.FieldOrMethod.setAttributes.

public final String
toString()

Overrides java.lang.Object.toString.

Return string representation close to declaration format, eg: 'public static void main(String[] args) throws IOException'
Inherited from org.aspectj.apache.bcel.classfile.FieldOrMethod:
dumpgetAnnotationsgetAttributesgetConstantPoolgetDeclaredSignaturegetGenericSignaturegetNamegetNameIndexgetSignaturegetSignatureIndex

Field Detail

NO_PARAMETER_ANNOTATIONSback to summary
public static final AnnotationGen[][] NO_PARAMETER_ANNOTATIONS
NoMethodsback to summary
public static final Method[] NoMethods
parameterAnnotationsOutOfDateback to summary
private boolean parameterAnnotationsOutOfDate
unpackedParameterAnnotationsback to summary
private AnnotationGen[][] unpackedParameterAnnotations

Constructor Detail

Methodback to summary
private Method()
Methodback to summary
public Method(Method c)

Initialize from another object. Note that both objects use the same references (shallow copy). Use clone() for a physical copy.

Methodback to summary
pack-priv Method(DataInputStream file, ConstantPool constant_pool) throws IOException
Methodback to summary
public Method(int access_flags, int name_index, int signature_index, Attribute[] attributes, ConstantPool constant_pool)

Method Detail

acceptback to summary
public void accept(ClassVisitor v)

Implements org.aspectj.apache.bcel.classfile.Node.accept.

ensureParameterAnnotationsUnpackedback to summary
private void ensureParameterAnnotationsUnpacked()
getAnnotationsOnParameterback to summary
public AnnotationGen[] getAnnotationsOnParameter(int i)
getArgumentTypesback to summary
public Type[] getArgumentTypes()
Returns:Type[]

array of method argument types

getCodeback to summary
public final Code getCode()
Returns:Code

Code attribute of method, if any

getExceptionTableback to summary
public final ExceptionTable getExceptionTable()
getLineNumberTableback to summary
public final LineNumberTable getLineNumberTable()

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

getLocalVariableTableback to summary
public final LocalVariableTable getLocalVariableTable()

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

getParameterAnnotationsback to summary
public AnnotationGen[][] getParameterAnnotations()
getReturnTypeback to summary
public Type getReturnType()
Returns:Type

return type of method

setAttributesback to summary
public void setAttributes(Attribute[] attributes)

Overrides org.aspectj.apache.bcel.classfile.FieldOrMethod.setAttributes.

Parameters
attributes:Attribute[]

Doc from org.aspectj.apache.bcel.classfile.FieldOrMethod.setAttributes.

Collection of object attributes.

Annotations
@Override
toStringback to summary
public final String toString()

Overrides java.lang.Object.toString.

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

Returns:String

Doc from java.lang.Object.toString.

a string representation of the object.

Annotations
@Override