diff --git a/jode/jode/jvm/RuntimeEnvironment.java b/jode/jode/jvm/RuntimeEnvironment.java index d6d08c9..2f36c66 100644 --- a/jode/jode/jvm/RuntimeEnvironment.java +++ b/jode/jode/jvm/RuntimeEnvironment.java @@ -26,9 +26,14 @@ import java.lang.reflect.InvocationTargetException; * invoke methods, etc.
* * The objects used in this runtime environment need not to be of the - * real class, but could also be of some wrapper class. The only - * exception are arrays, which must be arrays (but not necessarily of - * the real element type).
+ * real type, but can be some other type of your choice. But some + * mappings must be preserved, since they are used inside the + * Interpreter: + * * * @author Jochen Hoenicke */ public interface RuntimeEnvironment { @@ -65,28 +70,52 @@ public interface RuntimeEnvironment { * @param isVirtual true, iff the call is virtual * @param cls the object on which the method should be called, null * if the method is static. - * @param params the params of the method. Primitive types are - * wrapped to Object. - * @return the return value of the method. Primitive types are - * wrapped to Object, void type is ignored, may be null. + * @param params the params of the method. + * @return the return value of the method. Void type is ignored, + * may be null. * @exception InterpreterException if the field does not exists, the * object is not supported etc. */ public Object invokeMethod(Reference methodRef, boolean isVirtual, Object cls, Object[] params) throws InterpreterException, InvocationTargetException; + + /** + * Create a new instance of an object. + * @param methodRef the reference of the constructor to invoke + * @param params the params of the method. + * @return the new object. + */ public Object invokeConstructor(Reference methodRef, Object[] params) throws InterpreterException, InvocationTargetException; + /** + * Check if obj is an instance of className + * @param className the type signature of the class. + * @return true, if obj is an instance of className, false otherwise. + */ public boolean instanceOf(Object obj, String className) throws InterpreterException; + /** + * Create a new multidimensional Array. + * @param type the type of the elements. + * @param dimensions the size in every dimension. + * @return the new array (this must be an array, see class comment). + */ public Object newArray(String type, int[] dimensions) throws InterpreterException; + /** + * Enter a monitor. + * @param object the object whose monitor should be taken. + */ public void enterMonitor(Object obj) throws InterpreterException; + /** + * Exit a monitor. + * @param object the object whose monitor should be freed. + */ public void exitMonitor(Object obj) throws InterpreterException; } -