Logo Search packages:      
Sourcecode: jamvm version File versions

java::lang::reflect::Method Class Reference

List of all members.

Detailed Description

The Method class represents a member method of a class. It also allows dynamic invocation, via reflection. This works for both static and instance methods. Invocation on Method objects knows how to do widening conversions, but throws IllegalArgumentException if a narrowing conversion would be necessary. You can query for information on this Method regardless of location, but invocation access may be limited by Java language access controls. If you can't do it in the compiler, you can't normally do it here either.

Note: This class returns and accepts types as Classes, even primitive types; there are Class types defined that represent each different primitive type. They are java.lang.Boolean.TYPE, java.lang.Byte.TYPE,, also available as boolean.class, byte.class, etc. These are not to be confused with the classes java.lang.Boolean, java.lang.Byte, etc., which are real classes.

Also note that this is not a serializable class. It is entirely feasible to make it serializable using the Externalizable interface, but this is on Sun, not me.

John Keiser

Eric Blake <ebb9@email.byu.edu>

See also:






1.1 updated to 1.4

Definition at line 80 of file Method.java.

Public Member Functions

boolean equals (Object o)
Class getDeclaringClass ()
Class[] getExceptionTypes ()
int getModifiers ()
String getName ()
Class[] getParameterTypes ()
Class getReturnType ()
int hashCode ()
Object invoke (Object o, Object[] args) throws IllegalAccessException, InvocationTargetException
String toString ()

Package Attributes

Class declaringClass
String name
int slot

Private Member Functions

native int getMethodModifiers (int slot)
native Object invokeNative (Object o, Object[] args, Class declaringClass, Class[] parameterTypes, Class returnType, int slot) throws IllegalAccessException, InvocationTargetException
 Method (Class declaringClass, Class[] parameterTypes, Class[] exceptionTypes, Class returnType, String name, int slot)

Private Attributes

Class[] exceptionTypes
Class[] parameterTypes
Class returnType

The documentation for this class was generated from the following file:

Generated by  Doxygen 1.6.0   Back to index