alt.jiapi.reflect
Class JiapiMethod

java.lang.Object
  extended by alt.jiapi.reflect.JiapiMethod

public class JiapiMethod
extends java.lang.Object

This class represents a Method.

Version:
$Revision: 1.43 $ $Date: 2010/04/29 05:54:57 $
Author:
Mika Riekkinen, Joni Suominen

Constructor Summary
JiapiMethod(Method m)
          Constructor for JiapiMethod.
 
Method Summary
 LocalVariable addLocalVariable(java.lang.String type, java.lang.String name)
          Adds a local variable for this method.
 JiapiAnnotation[] getDeclaredAnnotations()
          Get all the declared annotations of this method.
 JiapiClass getDeclaringClass()
          Gets the class that declared this JiapiMethod.
 java.lang.String[] getExceptionNames()
          Gets the names of exceptions this method can throw.
 JiapiClass[] getExceptionTypes()
          Gets the parameter types of exceptions this method can throw.
 InstructionFactory getInstructionFactory()
          Get the InstructionFactory.
 InstructionList getInstructionList()
          Get an InstructionList, that represents a byte-code of this method.
 java.util.List[] getInvisibleParameterAnnotations()
          Get all the invisible parameter annotations of this method.
 int getMaxLocals()
           
 int getMaxStack()
           
 int getModifiers()
          Gets modifiers of this Method.
 java.lang.String getName()
          Get the name of this Method.
 java.lang.String[] getParameterTypeNames()
          Gets the names of parameter types in this method's signature.
 JiapiClass[] getParameterTypes()
          Gets the parameter types in this method's signature.
 java.lang.String getReturnType()
          Gets the return type of a method.
 Signature getSignature()
          Gets the signature of this method.
 java.util.List[] getVisibleParameterAnnotations()
          Get all the visible parameter annotations of this method.
 boolean isSynthetic()
          Checks, whether or not this JiapiMethod is synthetic.
 java.lang.String toString()
          Convert this JiapiMethod to String.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JiapiMethod

public JiapiMethod(Method m)
Constructor for JiapiMethod.

Method Detail

addLocalVariable

public LocalVariable addLocalVariable(java.lang.String type,
                                      java.lang.String name)
Adds a local variable for this method.

Parameters:
type - a type of the local variable
name - a name of the local variable
Returns:
a local variable

getDeclaredAnnotations

public JiapiAnnotation[] getDeclaredAnnotations()
Get all the declared annotations of this method.

Returns:
Declared annotations

getDeclaringClass

public JiapiClass getDeclaringClass()
Gets the class that declared this JiapiMethod.

Returns:
a JiapiClass which declares this method

getExceptionNames

public java.lang.String[] getExceptionNames()
Gets the names of exceptions this method can throw. (e.g. "java.lang.ClassNotFoundException").

Returns:
an array of parameter type names

getExceptionTypes

public JiapiClass[] getExceptionTypes()
                               throws java.lang.ClassNotFoundException
Gets the parameter types of exceptions this method can throw. Types are loaded with the same Loader as declaring class was loaded with.

Returns:
an array of parameter types
Throws:
java.lang.ClassNotFoundException - is thrown, if one of the types could not be loaded
See Also:
getExceptionNames()

getInstructionFactory

public InstructionFactory getInstructionFactory()
Get the InstructionFactory.


getInstructionList

public InstructionList getInstructionList()
Get an InstructionList, that represents a byte-code of this method.

Returns:
InstructionList

getInvisibleParameterAnnotations

public java.util.List[] getInvisibleParameterAnnotations()
Get all the invisible parameter annotations of this method. Each entry in a list

Returns:
Parameter annotations

getMaxLocals

public int getMaxLocals()

getMaxStack

public int getMaxStack()

getModifiers

public int getModifiers()
Gets modifiers of this Method.

Returns:
Modifiers of this method
See Also:
Modifier

getName

public java.lang.String getName()
Get the name of this Method.

Returns:
name of the method

getParameterTypeNames

public java.lang.String[] getParameterTypeNames()
Gets the names of parameter types in this method's signature. (e.g. "java.lang.String", "com.Foo", "int")

Returns:
an array of parameter type names

getParameterTypes

public JiapiClass[] getParameterTypes()
                               throws java.lang.ClassNotFoundException
Gets the parameter types in this method's signature. Each of the parameters are loaded with the same Loader as the declaring class was loaded with.

Returns:
an array of parameter types
Throws:
java.lang.ClassNotFoundException - is thrown, if one of the types could not be loaded
See Also:
getParameterTypeNames()

getReturnType

public java.lang.String getReturnType()
Gets the return type of a method.

Returns:
the return type of a method

getSignature

public Signature getSignature()
Gets the signature of this method.

Returns:
method signature

getVisibleParameterAnnotations

public java.util.List[] getVisibleParameterAnnotations()
Get all the visible parameter annotations of this method. Each entry in a list

Returns:
Parameter annotations

isSynthetic

public boolean isSynthetic()
Checks, whether or not this JiapiMethod is synthetic.

Returns:
true, if this JiapiMethod is synthetic

toString

public java.lang.String toString()
Convert this JiapiMethod to String.

Overrides:
toString in class java.lang.Object


Copyright © 2001. Documenation generated August 26 2011.