orchard.java

Info for Java classes and members

add-classpath!

(add-classpath! url)
Similar to the deprecated `clojure.core/add-classpath`, adds the URL to the
classpath and returns it if successful, or nil otherwise.

cache

cache?

(cache? info)
Whether to cache the class info; this will be true if the source file is
effectively immutable, and false otherwise. Specifically, this returns true if
no source file is available, or if the source file is in a jar/zip archive.

class-info

(class-info class)
For the class symbol, return (possibly cached) Java class and member info.
Members are indexed first by name, and then by argument types to list all
overloads.

class-info*

(class-info* class)
For the class symbol, return Java class and member info. Members are indexed
first by name, and then by argument types to list all overloads.

javadoc-url

(javadoc-url class)(javadoc-url class member argtypes)
Return the relative `.html` javadoc path and member fragment.

jdk-resource-url

(jdk-resource-url & path-segments)
Returns url to file at PATH-SEGMENTS relative to `jdk-root`.

jdk-root

The JDK root directory (parent of the `java.home` JRE directory)

jdk-sources

The JDK sources path. If available, this is added to the classpath. By
convention, this is the file `src.zip` in the root of the JDK directory.

jdk-tools

The JDK `tools.jar` path. If available, this is added to the classpath.

member-info

(member-info class member)
For the class and member symbols, return Java member info. If the member is
overloaded, line number and javadoc signature are that of the first overload.
If the member's definition is in a superclass, info returned will be for the
implemention. If the member is an instance member, `this` is prepended to its
arglists.

Reflected

protocol

members

reflect-info

(reflect-info o)

resolve-class

(resolve-class ns sym)
Given namespace and class symbols, search the imported classes and return
class info. If not found, search all classes on the classpath (requires a
qualified name).

resolve-member

(resolve-member ns sym)
Given namespace and member symbols, search the imported classes and return
a list of each matching member's info.

resolve-symbol

(resolve-symbol ns sym)
Given a namespace and a class or member symbol, resolve the class/member.
Class symbols, constructors, and static calls are resolved to the class
unambiguously. Instance members are resolved unambiguously if defined by only
one imported class. If multiple imported classes have a member by that name, a
map of class names to member info is returned as `:candidates`.

source-info

When `tools.jar` is available, return class info from its parsed source;
otherwise return nil.

type-info

(type-info class)
For the class or interface symbol, return Java type info. If the type has
defined contructors, the line and column returned will be for the first of
these for more convenient `jump` navigation.

typesym

(typesym o)