[armedbear-cvs] r12315 - trunk/abcl/src/org/armedbear/lisp
Alessio Stalla
astalla at common-lisp.net
Wed Dec 30 22:46:35 UTC 2009
Author: astalla
Date: Wed Dec 30 17:46:31 2009
New Revision: 12315
Log:
Implemented (setf jfield).
Modified:
trunk/abcl/src/org/armedbear/lisp/java.lisp
Modified: trunk/abcl/src/org/armedbear/lisp/java.lisp
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/java.lisp (original)
+++ trunk/abcl/src/org/armedbear/lisp/java.lisp Wed Dec 30 17:46:31 2009
@@ -217,6 +217,14 @@
"Returns the name of FIELD as a Lisp string"
(jcall (jmethod "java.lang.reflect.Field" "getName") field))
+
+(defun (setf jfield) (newvalue class-ref-or-field field-or-instance
+ &optional (instance nil instance-supplied-p) unused-value)
+ (declare (ignore unused-value))
+ (if instance-supplied-p
+ (jfield class-ref-or-field field-or-instance instance newvalue)
+ (jfield class-ref-or-field field-or-instance newvalue)))
+
(defun jclass-methods (class &key declared public)
"Return a vector of all (or just the declared/public, if DECLARED/PUBLIC is true) methods of CLASS"
(let* ((getter (if declared "getDeclaredMethods" "getMethods"))
@@ -227,9 +235,13 @@
"Returns a vector of parameter types (Java classes) for METHOD"
(jcall (jmethod "java.lang.reflect.Method" "getParameterTypes") method))
-;; (defun jmethod-return-type (method)
-;; "Returns the result type (Java class) of the METHOD"
-;; (jcall (jmethod "java.lang.reflect.Method" "getReturnType") method))
+(defun jmethod-return-type (method)
+ "Returns the result type (Java class) of the METHOD"
+ (jcall (jmethod "java.lang.reflect.Method" "getReturnType") method))
+
+(defun jmethod-declaring-class (method)
+ "Returns the Java class declaring METHOD"
+ (jcall (jmethod "java.lang.reflect.Method" "getDeclaringClass") method))
(defun jmethod-name (method)
"Returns the name of METHOD as a Lisp string"
More information about the armedbear-cvs
mailing list