Changeset 4953


Ignore:
Timestamp:
12/03/03 11:13:20 (18 years ago)
Author:
asimon
Message:

removed JCLASS-FOR-NAME
added three more convenience functions for Java reflection

Location:
trunk/j/src/org/armedbear/lisp
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/j/src/org/armedbear/lisp/autoloads.lisp

    r4891 r4953  
    22;;;
    33;;; Copyright (C) 2003 Peter Graves
    4 ;;; $Id: autoloads.lisp,v 1.70 2003-11-25 00:33:25 piso Exp $
     4;;; $Id: autoloads.lisp,v 1.71 2003-12-03 11:13:20 asimon Exp $
    55;;;
    66;;; This program is free software; you can redistribute it and/or
     
    136136(export 'jclass-name "JAVA")
    137137(autoload 'jclass-name "java.lisp")
    138 (export 'jclass-for-name "JAVA")
    139 (autoload 'jclass-for-name "java.lisp")
    140138(export 'jobject-class "JAVA")
    141139(autoload 'jobject-class "java.lisp")
     
    146144(export 'jclass-interface-p "JAVA")
    147145(autoload 'jclass-interface-p "java.lisp")
     146(export 'jclass-superclass-p "JAVA")
     147(autoload 'jclass-superclass-p "java.lisp")
     148(export 'jclass-array-p "JAVA")
     149(autoload 'jclass-array-p "java.lisp")
     150(export 'jarray-component-type "JAVA")
     151(autoload 'jarray-component-type "java.lisp")
    148152(export 'jclass-constructors "JAVA")
    149153(autoload 'jclass-constructors "java.lisp")
  • trunk/j/src/org/armedbear/lisp/java.lisp

    r4947 r4953  
    22;;;
    33;;; Copyright (C) 2003 Peter Graves
    4 ;;; $Id: java.lisp,v 1.8 2003-12-02 22:29:59 dmcnaught Exp $
     4;;; $Id: java.lisp,v 1.9 2003-12-03 11:13:20 asimon Exp $
    55;;;
    66;;; This program is free software; you can redistribute it and/or
     
    2727  (jcall (jmethod "java.lang.Class" "getName") class))
    2828
    29 (defun jclass-for-name (name)
    30   "Returns the class of name NAME"
    31   (jstatic "forName" "java.lang.Class" name))
    32 
    3329(defun jobject-class (obj)
    3430  "Returns the Java class that OBJ belongs to"
     
    5248  "Returns T if CLASS is an interface"
    5349  (jcall (jmethod "java.lang.Class" "isInterface") (ensure-jclass class)))
     50
     51(defun jclass-superclass-p (class-1 class-2)
     52  "Returns T if CLASS-1 is a superclass or interface of CLASS-2"
     53  (jcall (jmethod "java.lang.Class" "isAssignableFrom" "java.lang.Class")
     54   (ensure-jclass class-1)
     55   (ensure-jclass class-2)))
     56
     57(defun jclass-array-p (class)
     58  "Returns T if CLASS is an array class"
     59  (jcall (jmethod "java.lang.Class" "isArray") (ensure-jclass class)))
     60
     61(defun jarray-component-type (atype)
     62  "Returns the component type of the array type ATYPE"
     63  (assert (jclass-array-p atype))
     64  (jcall (jmethod "java.lang.Class" "getComponentType") atype))
    5465
    5566(defun jclass-constructors (class)
Note: See TracChangeset for help on using the changeset viewer.