|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.vub.at.objects.mirrors.JavaInterfaceAdaptor
JavaInterfaceAdaptor is a class providing several static methods which allow accessing and invoking Java methods which represent native AmbientTalk methods. It is used by the Reflection class to up ambienttalk invocations and field accesses and translate them using java reflection.
Constructor Summary | |
JavaInterfaceAdaptor()
|
Method Summary | |
static java.lang.reflect.Method[] |
allMethodsPrefixed(java.lang.Class fromClass,
java.lang.String prefix,
boolean isStatic)
Returns all public methods from the given class parameter whose name starts with the given prefix. |
static java.lang.Object |
atObjectToPrimitiveJava(ATObject atObj,
java.lang.Class type)
|
private static java.lang.Object[] |
coerceArguments(ATObject[] args,
java.lang.Class[] types)
|
static ATObject |
createNativeATObject(java.lang.Class jClass,
ATObject[] jInitArgs)
Try to create a new instance of a Java class given an array of initialization arguments. |
private static java.lang.reflect.Method[] |
getMethodsForSelector(java.lang.Class jClass,
java.lang.String selector)
Since Java uses strict matching when asked for a method, given an array of classes, this often means that the types are overspecified and therefore no matches can be found. |
static java.lang.reflect.Method |
getNativeATMethod(java.lang.Class baseInterface,
ATObject receiver,
java.lang.String methodName)
|
static boolean |
hasApplicableJavaMethod(java.lang.Class jClass,
java.lang.String jSelector)
Tests given a class, whether the class either declares or inherits a method for a given selector. |
static ATObject |
invokeNativeATMethod(java.lang.Class jClass,
ATObject natReceiver,
java.lang.String jSelector,
ATObject[] jArguments)
Invokes a method on a Java object identified by a selector. |
static ATObject |
invokeNativeATMethod(java.lang.reflect.Method javaMethod,
ATObject jReceiver,
ATObject[] jArguments)
Invokes a method on a native AmbientTalk object identified by a java.lang.reflect.Method object. |
static boolean |
isPrimitiveType(java.lang.Class c)
|
static ATObject |
primitiveJavaToATObject(java.lang.Object jObj)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public JavaInterfaceAdaptor()
Method Detail |
public static boolean hasApplicableJavaMethod(java.lang.Class jClass, java.lang.String jSelector)
jClass
- - a Java class, representing an AT object.jSelector
- - a selector, describing the method to be searched for.
public static ATObject invokeNativeATMethod(java.lang.Class jClass, ATObject natReceiver, java.lang.String jSelector, ATObject[] jArguments) throws InterpreterException
jClass
- the class of the receiver objectnatReceiver
- the receiver (a native AmbientTalk object)jSelector
- the java-level selector identifying the method to invokejArguments
- parameters, normally AT objects
InterpreterException
public static ATObject invokeNativeATMethod(java.lang.reflect.Method javaMethod, ATObject jReceiver, ATObject[] jArguments) throws InterpreterException
javaMethod
- the Java method to invokejReceiver
- the Java object representing the receiver (normally an AT object)jArguments
- the AT arguments to pass
InterpreterException
public static ATObject createNativeATObject(java.lang.Class jClass, ATObject[] jInitArgs) throws InterpreterException
InterpreterException
public static java.lang.reflect.Method getNativeATMethod(java.lang.Class baseInterface, ATObject receiver, java.lang.String methodName) throws InterpreterException
InterpreterException
public static java.lang.reflect.Method[] allMethodsPrefixed(java.lang.Class fromClass, java.lang.String prefix, boolean isStatic)
private static java.lang.reflect.Method[] getMethodsForSelector(java.lang.Class jClass, java.lang.String selector)
jClass
- - the class from which the methods will be selected.selector
- - the name of the requested method.
private static java.lang.Object[] coerceArguments(ATObject[] args, java.lang.Class[] types) throws XTypeMismatch
XTypeMismatch
public static final boolean isPrimitiveType(java.lang.Class c)
public static final ATObject primitiveJavaToATObject(java.lang.Object jObj) throws XReflectionFailure
XReflectionFailure
public static final java.lang.Object atObjectToPrimitiveJava(ATObject atObj, java.lang.Class type) throws InterpreterException
InterpreterException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |