|
Jode 1.90-CVS Build Aug 6, 2004 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.jode.jvm.SimpleRuntimeEnvironment
This is a runtime environment using reflection. Monitors are not supported by this class so exit/enterMonitor will through an InterpreterException.
Constructor Summary | |
SimpleRuntimeEnvironment()
|
Method Summary | |
void |
enterMonitor(java.lang.Object obj)
Enter a monitor. |
void |
exitMonitor(java.lang.Object obj)
Exit a monitor. |
static java.lang.Object |
fromReflectType(java.lang.String typeSig,
java.lang.Object value)
|
java.lang.Object |
getField(Reference ref,
java.lang.Object obj)
Get the value of a field member. |
boolean |
instanceOf(java.lang.Object obj,
java.lang.String className)
Check if obj is an instance of className |
java.lang.Object |
invokeConstructor(Reference ref,
java.lang.Object[] params)
Create a new instance of an object. |
java.lang.Object |
invokeMethod(Reference ref,
boolean isVirtual,
java.lang.Object cls,
java.lang.Object[] params)
Invoke a method. |
java.lang.Object |
newArray(java.lang.String type,
int[] dimensions)
Create a new multidimensional Array. |
void |
putField(Reference ref,
java.lang.Object obj,
java.lang.Object value)
Set the value of a field member. |
static java.lang.Object |
toReflectType(java.lang.String typeSig,
java.lang.Object value)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public SimpleRuntimeEnvironment()
Method Detail |
public static java.lang.Object fromReflectType(java.lang.String typeSig, java.lang.Object value)
public static java.lang.Object toReflectType(java.lang.String typeSig, java.lang.Object value)
public java.lang.Object getField(Reference ref, java.lang.Object obj) throws InterpreterException
RuntimeEnvironment
getField
in interface RuntimeEnvironment
ref
- the Reference of the field.obj
- the object of which the field should be taken, null
if the field is static.
InterpreterException
- if the field does not exists, the
object is not supported etc.public void putField(Reference ref, java.lang.Object obj, java.lang.Object value) throws InterpreterException
RuntimeEnvironment
putField
in interface RuntimeEnvironment
ref
- the Reference of the field.obj
- the object of which the field should be taken, null
if the field is static.value
- the field value. Primitive types are wrapped to
Object.
InterpreterException
- if the field does not exists, the
object is not supported etc.public java.lang.Object invokeConstructor(Reference ref, java.lang.Object[] params) throws InterpreterException, java.lang.reflect.InvocationTargetException
RuntimeEnvironment
invokeConstructor
in interface RuntimeEnvironment
ref
- the reference of the constructor to invokeparams
- the params of the method.
InterpreterException
java.lang.reflect.InvocationTargetException
public java.lang.Object invokeMethod(Reference ref, boolean isVirtual, java.lang.Object cls, java.lang.Object[] params) throws InterpreterException, java.lang.reflect.InvocationTargetException
RuntimeEnvironment
invokeMethod
in interface RuntimeEnvironment
ref
- the reference to the method.isVirtual
- true, iff the call is virtualcls
- the object on which the method should be called, null
if the method is static.params
- the params of the method.
InterpreterException
- if the field does not exists, the
object is not supported etc.
java.lang.reflect.InvocationTargetException
public boolean instanceOf(java.lang.Object obj, java.lang.String className) throws InterpreterException
RuntimeEnvironment
instanceOf
in interface RuntimeEnvironment
className
- the type signature of the class.
InterpreterException
public java.lang.Object newArray(java.lang.String type, int[] dimensions) throws InterpreterException, java.lang.NegativeArraySizeException
RuntimeEnvironment
newArray
in interface RuntimeEnvironment
type
- the type of the elements.dimensions
- the size in every dimension.
InterpreterException
java.lang.NegativeArraySizeException
public void enterMonitor(java.lang.Object obj) throws InterpreterException
RuntimeEnvironment
enterMonitor
in interface RuntimeEnvironment
obj
- the object whose monitor should be taken.
InterpreterException
public void exitMonitor(java.lang.Object obj) throws InterpreterException
RuntimeEnvironment
exitMonitor
in interface RuntimeEnvironment
obj
- the object whose monitor should be freed.
InterpreterException
|
Jode 1.90-CVS Build Aug 6, 2004 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |