All Manuals > LispWorks® User Guide and Reference Manual > 39 The LW-JI Package

verify-java-callers Function

Summary

Verify all Java callers and return information about which was successful.

Package

lw-ji

Signature

verify-java-callers &key classes return => result

Arguments
classes
A list of strings, or nil.
return
t, or one of the keywords :name-only, :name, :info-only and :successful.
Values
result
A list.
Description

The function verify-java-callers verifies all Java callers and returns information about which was successful and which was not.

If classes is non-nil, it must be a list of strings specifying Java classes. In this case, verify-java-callers verifies only callers for these classes. By default verify-java-callers verifies all callers that were defined by define-java-caller.

return specifies what to return. See below for details.

verify-java-callers maps through all the callers that were defined by define-java-caller on all classes (if classes is nil) or on the supplied classes.

Note that the importing interface defines the caller using define-java-caller and that define-java-callers also expands to define-java-caller, so verify-java-callers verifies these callers too. verify-java-callers does not verify constructors or field accessors.

For each caller, verify-java-callers looks up the Java class and the method of the caller (unless it is already cached), and caches the information so calls to the caller and future verifications can use it.

verify-java-callers returns a list containing an item for each failed lookup, except when return is the keyword :successful, in which case there is an item for each successful lookup. The value of each item depends on the value of return as follows:

t
Each item is a cons (args . condition) where args is a list (name class-name method-name) of the required arguments of the define-java-caller form, and condition is the condition that was produced when looking up. Unless something very unusual happened, this condition will be of type either java-class-error (if it failed to find the class) or java-method-error (if it failed to find the method).
:name-only
Each item is the name of the caller that failed.
:name
Each item is a cons where the cl:car is the name caller and the cl:cdr is the condition that was generated when trying the lookup.
:info-only
Each item is the list (name class-name method-name) of the required arguments for define-java-caller of the failed caller.
:successful
Each item is the name of a successful caller.

The default value of return is t.

verify-java-callers requires running Java.

Verification is useful to guard against typing mistakes when you typed the define-java-callers explicitly because that does not do any lookup until run time, or when you are not sure that the class definition has not changed between the time you imported the definition and the time it is used.

The intention is that you call verify-java-callers on starting your application, at least during the development phase, log the result and check it to see if anything is missing.

See also

verify-java-caller
define-java-caller
define-java-callers
15.2 Calling from Lisp to Java


LispWorks® User Guide and Reference Manual - 01 Dec 2021 19:30:46