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




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




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



A list of strings, or nil.


t, or one of the keywords :name-only, :name, :info-only and :successful.



A list.


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 default-constructor-arguments.

return specifies what to return. See below for details.

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

Note that the importing interface defines the caller using default-constructor-arguments and that define-java-callers also expands to default-constructor-arguments, 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:


Each item is a cons (args . condition) where args is a list (name class-name method-name) of the required arguments of the default-constructor-arguments 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).


Each item is the name of the caller that failed.


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.


Each item is the list (name class-name method-name) of the required arguments for default-constructor-arguments of the failed caller.


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 runtime, 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

Calling from Lisp to Java

LispWorks User Guide and Reference Manual - 13 Feb 2015