org.jikesrvm.runtime
Class ReflectionBase

java.lang.Object
  extended by org.jikesrvm.runtime.ReflectionBase

public abstract class ReflectionBase
extends Object

Base class for all reflective method invoker classes, contains utility methods that are invoked to unwrap the reflective arguments. Also contains invoke(RVMMethod, Object, Object[]) that is called to perform the reflective method call.


Field Summary
static ReflectionBase nullInvoker
          Reflective method invoker that performs no invocation
 
Constructor Summary
ReflectionBase()
           
 
Method Summary
protected static Object boxAsBoolean(boolean b)
          Wrap result as boolean
protected static Object boxAsByte(byte b)
          Wrap result as byte
protected static Object boxAsChar(char c)
          Wrap result as char
protected static Object boxAsDouble(double d)
          Wrap result as double
protected static Object boxAsFloat(float f)
          Wrap result as float
protected static Object boxAsInt(int i)
          Wrap result as int
protected static Object boxAsLong(long l)
          Wrap result as long
protected static Object boxAsShort(short s)
          Wrap result as short
 Object invoke(RVMMethod method, Object obj, Object[] args)
          Invoke reflective method being wrapped by this object
abstract  Object invokeInternal(Object obj, Object[] args)
          Invoke reflective method being wrapped by this object, internal method specific part.
private static void throwIllegalArgumentException()
          Throw error with argument
protected static boolean unboxAsBoolean(Object obj)
          Unwrap boolean for call
protected static byte unboxAsByte(Object obj)
          Unwrap boolean for call
protected static char unboxAsChar(Object obj)
          Unwrap char for call
protected static double unboxAsDouble(Object obj)
          Unwrap double for call
protected static float unboxAsFloat(Object obj)
          Unwrap float for call
protected static int unboxAsInt(Object obj)
          Unwrap int for call
protected static long unboxAsLong(Object obj)
          Unwrap long for call
protected static short unboxAsShort(Object obj)
          Unwrap short for call
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

nullInvoker

public static final ReflectionBase nullInvoker
Reflective method invoker that performs no invocation

Constructor Detail

ReflectionBase

public ReflectionBase()
Method Detail

throwIllegalArgumentException

private static void throwIllegalArgumentException()
                                           throws IllegalArgumentException
Throw error with argument

Throws:
IllegalArgumentException

unboxAsBoolean

protected static boolean unboxAsBoolean(Object obj)
Unwrap boolean for call


boxAsBoolean

protected static Object boxAsBoolean(boolean b)
Wrap result as boolean


unboxAsByte

protected static byte unboxAsByte(Object obj)
Unwrap boolean for call


boxAsByte

protected static Object boxAsByte(byte b)
Wrap result as byte


unboxAsShort

protected static short unboxAsShort(Object obj)
Unwrap short for call


boxAsShort

protected static Object boxAsShort(short s)
Wrap result as short


unboxAsChar

protected static char unboxAsChar(Object obj)
Unwrap char for call


boxAsChar

protected static Object boxAsChar(char c)
Wrap result as char


unboxAsInt

protected static int unboxAsInt(Object obj)
Unwrap int for call


boxAsInt

protected static Object boxAsInt(int i)
Wrap result as int


unboxAsLong

protected static long unboxAsLong(Object obj)
Unwrap long for call


boxAsLong

protected static Object boxAsLong(long l)
Wrap result as long


unboxAsFloat

protected static float unboxAsFloat(Object obj)
Unwrap float for call


boxAsFloat

protected static Object boxAsFloat(float f)
Wrap result as float


unboxAsDouble

protected static double unboxAsDouble(Object obj)
Unwrap double for call


boxAsDouble

protected static Object boxAsDouble(double d)
Wrap result as double


invokeInternal

public abstract Object invokeInternal(Object obj,
                                      Object[] args)
Invoke reflective method being wrapped by this object, internal method specific part.

Parameters:
obj - object for virtual method invocation
args - arguments to method call
Returns:
the object that is the result of the invoke

invoke

public final Object invoke(RVMMethod method,
                           Object obj,
                           Object[] args)
Invoke reflective method being wrapped by this object

Parameters:
obj - object for virtual method invocation
args - arguments to method call
Returns:
the object that is the result of the invoke