| java.lang.Object java.lang.reflect.VMReflection
VMReflection | final class VMReflection (Code) | | Provides the package private methods requirered for the
java.lang.reflect package implementation.
This class must be implemented according to the common policy for porting
interfaces - see the porting interface overview for more detailes.
Note: this class design is based on requirements for the
Field ,
Method and
Constructor classes from the
java.lang.reflect package. Each class (Field, Method, Constructor)
should have a constructor that accepts an argument of the
java.lang.Object type. This argument serves as an identifier of
particular item. This identifier should be used later when one needs to
operate with an item. For example, see
VMReflection.getFieldType(Object)VMReflection.getFieldType(Object id) method.
|
getExceptionTypes | native static Class>[] getExceptionTypes(long id)(Code) | | This method satisfies the requirements of the specification for the
Method.getExceptionTypes Method.getExceptionTypes() method. But
it takes one additional id parameter.
Parameters: id - an identifier of the caller class. |
getFieldType | native static Class> getFieldType(long id)(Code) | | This method satisfies the requirements of the specification for the
Field.getType Field.getType() method. But it takes one
additional id parameter.
Parameters: id - an identifier of the caller class. |
getMethodReturnType | native static Class> getMethodReturnType(long id)(Code) | | This method satisfies the requirements of the specification for the
Method.getReturnType Method.getReturnType() method. But it
takes one additional id parameter.
Parameters: id - an identifier of the caller class. |
getParameterTypes | native static Class>[] getParameterTypes(long id)(Code) | | This method satisfies the requirements of the specification for the
Method.getParameterTypes Method.getParameterTypes() method. But
it takes one additional id parameter.
Parameters: id - an identifier of the caller class. |
invokeMethod | native static Object invokeMethod(long id, Object object, Object... args) throws InvocationTargetException(Code) | | This method satisfies the requirements of the specification for the
Method.invoke(java.lang.Objectjava.lang.Object[])Method.invoke(Object obj, Object[] args) method. But it differs in
several ways.
First, it takes one additional id parameter. This parameter
is used as an identifier to invoke corresponding method.
Second, it doesn't perform access control so it doesn't throw an
IllegalAccessException exception.
Third, it throws IllegalArgumentException only if the
args argument doesn't fit to the actual method parameters.
Last, it doesn't throw an NullPointerException exception. If
the id argument corresponds to a static method then the
object argument must be null. An attempt to invoke a static method will
be made in this case. If the id argument corresponds to a
non-static method then corresponding object's method will be invoked.
Note: Under design yet. Subjected to change.
Parameters: id - the identifier of the method to be invoked. |
newArrayInstance | native static Object newArrayInstance(Class> type, int[] dimensions)(Code) | | This method satisfies the requirements of the specification for the
Array.newInstance(Classint[])Array.newInstance(Class componentType, int[] dimensions) method. But it
differs in several ways.
First, it it doesn't throw an NullPointerException exception.
Second, it throws an IllegalArgumentException exception only
if the implementation doesn't support specified number of dimensions.
Note: Under design yet. Subjected to change.
|
newClassInstance | native static Object newClassInstance(long id, Object... args) throws InvocationTargetException(Code) | | This method satisfies the requirements of the specification for the
Constructor.newInstance(java.lang.Object[])Constructor.newInstance(java.lang.Object[] initargs) method. But it
differs in several ways.
First, it takes one additional id parameter. This parameter
is used as an identifier of the corresponding constructor.
Second, it doesn't perform access control so it doesn't throw an
IllegalAccessException exception.
Last, it doesn't throw an InstantiationException exception.
The id argument must not correspond to an abstract class.
Note: Under design yet. Subjected to change.
Parameters: id - the identifier of the method to be invoked. |
|
|