silk
Class JavaMethod

java.lang.Object
silk.Procedure
silk.JavaMethod
- All Implemented Interfaces:
- java.lang.Runnable
- public class JavaMethod
- extends Procedure
This class allows you to call any Java method, just by naming it,
and doing the dispatch at runtime.
| Methods inherited from class silk.Procedure |
apply, makeArgArray, makeArgArray, nParms, run, setName, throwObject, throwRuntimeException, toString, toStringArgs, tryCatch, tryFinally |
methodName
private Symbol methodName
methodClass
private java.lang.Class methodClass
methodTable
private java.lang.Object[] methodTable
isStatic
private boolean isStatic
isSpecific
private boolean isSpecific
JavaMethod
public JavaMethod(java.lang.String name,
java.lang.Class c,
boolean isStatic)
- If the method is static then Class c is not null.
For instance methods, if Class c is not null, then
it is used at construct time to create a method table.
Otherwise, the class of the method is determined at
call time from the target, and the method table is
constructed then and cached. Examples:
new JavaMethod("getProperties", System.class, true) - static method
new JavaMethod("put", Hashtable.class,false) - specific instance method.
new JavaMethod("put", null, false) - unspecified instance method
JavaMethod
public JavaMethod(java.lang.String name,
java.lang.Class c)
isStatic
public boolean isStatic()
- Is this methodclass specified?
apply
public java.lang.Object apply(java.lang.Object[] args)
- Apply the method to a list of arguments.
- Specified by:
apply in class Procedure