Create a CLOS instance based on a jobject.
lw-ji
create-instance-from-jobject jobject &optional errorp => instance
jobject⇩ |
A jobject. |
errorp⇩ |
A generalized boolean. |
instance |
A CLOS object. |
The function create-instance-from-jobject
creates a CLOS instance based on the jobject jobject.
jobject must be a jobject. Its class name (that is, the result of jobject-class-name) must have been associated with the name of a CLOS subclass of standard-java-object using record-java-class-lisp-symbol (the importing interface, when defining a class, does it automatically).
create-instance-from-jobject
uses the record to find the class, and makes the CLOS instance by calling make-instance, passing it jobject.
The result is an instance of the CLOS class, which can be passed to Java interface functions and Java methods.
If create-instance-from-jobject
fails to find the CLOS class it signals an error if errorp is non-nil, otherwise it returns nil
. The default value of errorp is true.
LispWorks® User Guide and Reference Manual - 01 Dec 2021 19:30:46