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

NextPrevUpTopContentsIndex

get-superclass-and-interfaces-tree

Function
Summary

Returns the superclasses and implemented interfaces of a supplied Java class.

Package

lw-ji

Signature

get-superclass-and-interfaces-tree java-class => java-class-tree

Arguments

java-class

A jobject.

Values

java-class-tree

A tree.

Description

The function get-superclass-and-interfaces-tree takes a Java class and returns of its superclasses and implemented interfaces. It is used by the importing interface to generate a tree which is then output as argument to ensure-lisp-classes-from-tree. It may be useful on its own, as a quick way of finding the tree for a class.

java-class must be a Java class, that is a jobject corresponding to a class. Typically that would be the result of find-java-class, but it can be the result of your calls to Java methods. Using the Java methods "getInterfaces", "getSuperclass" and "getName" in the Java class "java.lang.Class", get-superclass-and-interfaces-tree constructs a complete tree of the superclasses and implemented interfaces of the class and its superclasses.

Each node in the tree is a vector of three elements:

0) The full name of the class as a string

1) A node for the superclass (in Java terminology, the one it extends), or nil if there is no superclass (for java.lang.Object and interfaces).

2) A list of nodes corresponding to the interfaces that the class implements.

get-superclass-and-interfaces-tree returns the node for the class itself.

See also

ensure-lisp-classes-from-tree
generate-java-class-definitions


LispWorks User Guide and Reference Manual - 20 Sep 2017

NextPrevUpTopContentsIndex