fr.umlv.corosol.component
Interface JClassMethod

All Superinterfaces:
JObject
All Known Subinterfaces:
JConstructor, JMethod
All Known Implementing Classes:
DefaultJConstructor, DefaultJMethod

public interface JClassMethod
extends JObject

This interface represents a class method (static or not) or a constructor.

Author:
Christophe Deleray

Method Summary
 byte[] getBytecode()
          Returns an array of bytes containg the byte code of the method or the constructor represented by this JClassMethod object.
 JClass getDeclaringClass()
          Returns the JClass object representing the class or interface that declares the method or the constructor represented by this JClassMethod object.
 java.lang.String getDescriptor()
          Returns the descriptor of the method or the constructor represented by this JClassMethod object, as a String.
 JClass[] getExceptionTypes()
          Returns an array of JClass objects that represent the types of the exceptions declared to be thrown by the underlying method represented by this JClassMethod object.
 int getMaxLocals()
          Returns the number of local variables in the local variable array allocated upon invocation of this method, including the local variables used to pass parameters to this method on its invocation.
 int getMaxStack()
          Returns the maximum depth of the operand stack of a frame at any point during execution of this method.
 int getModifiers()
          Returns the Java language modifiers for the method or the constructor represented by this JClassMethod object, as an integer.
 java.lang.String getName()
          Returns the name of the method or the constructor represented by this JClassMethod object, as a String.
 JClass[] getParameterTypes()
          Returns an array of JClass objects that represent the formal parameter types, in declaration order, of the method or the constructor represented by this JClassMethod object.
 void invoke(JMethodInvoker invoker, JThread thread)
          Invokes the methods represented by this JClassMethod via the specified method invoker and into the specified thread.
 

Method Detail

getDeclaringClass

JClass getDeclaringClass()
Returns the JClass object representing the class or interface that declares the method or the constructor represented by this JClassMethod object.


getName

java.lang.String getName()
Returns the name of the method or the constructor represented by this JClassMethod object, as a String.


getModifiers

int getModifiers()
Returns the Java language modifiers for the method or the constructor represented by this JClassMethod object, as an integer. The Modifier class should be used to decode the modifiers.

See Also:
Modifier

getDescriptor

java.lang.String getDescriptor()
Returns the descriptor of the method or the constructor represented by this JClassMethod object, as a String.


getParameterTypes

JClass[] getParameterTypes()
Returns an array of JClass objects that represent the formal parameter types, in declaration order, of the method or the constructor represented by this JClassMethod object. Returns an array of length 0 if the underlying method takes no parameters.

Returns:
the parameter types for the method or the constructor this object represents

getExceptionTypes

JClass[] getExceptionTypes()
Returns an array of JClass objects that represent the types of the exceptions declared to be thrown by the underlying method represented by this JClassMethod object. Returns an array of length 0 if the method or the constructor declares no exceptions in its throws clause.

Returns:
the exception types declared as being thrown by the method or the constructor this object represents

getBytecode

byte[] getBytecode()
Returns an array of bytes containg the byte code of the method or the constructor represented by this JClassMethod object.

Returns:
the byte code of the method or the constructor

getMaxStack

int getMaxStack()
Returns the maximum depth of the operand stack of a frame at any point during execution of this method.


getMaxLocals

int getMaxLocals()
Returns the number of local variables in the local variable array allocated upon invocation of this method, including the local variables used to pass parameters to this method on its invocation.


invoke

void invoke(JMethodInvoker invoker,
            JThread thread)
            throws java.lang.Exception
Invokes the methods represented by this JClassMethod via the specified method invoker and into the specified thread.

Parameters:
invoker - a method invoker
thread - the thread into which the method will be executed
Throws:
java.lang.Exception - if the executed method throws an exception