|
Jode 1.90-CVS Build Aug 6, 2004 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
This interface is used by the Interpreter to actually modify objects,
invoke methods, etc.
The objects used in this runtime environment need not to be of the
real type, but can be some other type of your choice. But some
mappings must be preserved, since they are used inside the
Interpreter:
SimpleRuntimeEnvironment
Method Summary | |
void |
enterMonitor(java.lang.Object obj)
Enter a monitor. |
void |
exitMonitor(java.lang.Object obj)
Exit a monitor. |
java.lang.Object |
getField(Reference fieldref,
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 methodRef,
java.lang.Object[] params)
Create a new instance of an object. |
java.lang.Object |
invokeMethod(Reference methodRef,
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 fieldref,
java.lang.Object obj,
java.lang.Object value)
Set the value of a field member. |
Method Detail |
public java.lang.Object getField(Reference fieldref, java.lang.Object obj) throws InterpreterException
fieldref
- 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 fieldref, java.lang.Object obj, java.lang.Object value) throws InterpreterException
fieldref
- 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 invokeMethod(Reference methodRef, boolean isVirtual, java.lang.Object cls, java.lang.Object[] params) throws InterpreterException, java.lang.reflect.InvocationTargetException
methodRef
- 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 java.lang.Object invokeConstructor(Reference methodRef, java.lang.Object[] params) throws InterpreterException, java.lang.reflect.InvocationTargetException
methodRef
- the reference of the constructor to invokeparams
- the params of the method.
InterpreterException
java.lang.reflect.InvocationTargetException
public boolean instanceOf(java.lang.Object obj, java.lang.String className) throws InterpreterException
className
- the type signature of the class.
InterpreterException
public java.lang.Object newArray(java.lang.String type, int[] dimensions) throws InterpreterException
type
- the type of the elements.dimensions
- the size in every dimension.
InterpreterException
public void enterMonitor(java.lang.Object obj) throws InterpreterException
obj
- the object whose monitor should be taken.
InterpreterException
public void exitMonitor(java.lang.Object obj) throws InterpreterException
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 |