Liking cljdoc? Tell your friends :D

com.fulcrologic.java-info.repl

Utilities for extracting Java API information for display at the REPL.

This namespace provides functions to retrieve javadoc documentation and source code for Java classes and methods, making it easier to work with Java libraries from Clojure.

Utilities for extracting Java API information for display at the REPL.

This namespace provides functions to retrieve javadoc documentation and
source code for Java classes and methods, making it easier to work with
Java libraries from Clojure.
raw docstring

find-classesclj

(find-classes simple-name)

Find all fully-qualified class names on the classpath matching a simple class name.

Parameters:

  • simple-name: A string containing the simple (unqualified) class name to search for

Returns: A vector of strings containing all fully-qualified class names on the current classpath that have the given simple name, or nil if none are found.

This function is useful when you know a class's simple name (e.g., 'ArrayList') but need to find its fully-qualified name (e.g., 'java.util.ArrayList').

Example:

(find-classes "File") ; => ["java.io.File" ...]
Find all fully-qualified class names on the classpath matching a simple class name.

Parameters:
- simple-name: A string containing the simple (unqualified) class name to search for

Returns:
A vector of strings containing all fully-qualified class names on the current
classpath that have the given simple name, or nil if none are found.

This function is useful when you know a class's simple name (e.g., 'ArrayList')
but need to find its fully-qualified name (e.g., 'java.util.ArrayList').

Example:
```clojure
(find-classes "File") ; => ["java.io.File" ...]
```
sourceraw docstring

javadocclj

(javadoc class-name)
(javadoc class-name method-name)
(javadoc class-name method-name options)

Get Javadoc documentation for a Java class or method.

When called with just a class name, returns the class-level documentation. When called with a class name and method name, returns documentation for all overloaded versions of that method.

Parameters:

  • class-name: A string containing the fully-qualified class name
  • method-name: (Optional) A string containing the method name to get docs for
  • options: (Optional) A map containing configuration options:
    • :max-class-length - Maximum length for class documentation (default: 1000)
    • :max-method-length - Maximum length for method documentation (default: 600)
    • :max-param-length - Maximum length for parameter documentation (default: 200)

Returns: For a class: A string containing the class documentation (truncated if too long) For a method: A string with all overloaded method signatures and their respective documentation, clearly separated and truncated if needed

Get Javadoc documentation for a Java class or method.

When called with just a class name, returns the class-level documentation.
When called with a class name and method name, returns documentation for all
overloaded versions of that method.

Parameters:
- class-name: A string containing the fully-qualified class name
- method-name: (Optional) A string containing the method name to get docs for
- options: (Optional) A map containing configuration options:
  - :max-class-length - Maximum length for class documentation (default: 1000)
  - :max-method-length - Maximum length for method documentation (default: 600)
  - :max-param-length - Maximum length for parameter documentation (default: 200)

Returns:
For a class: A string containing the class documentation (truncated if too long)
For a method: A string with all overloaded method signatures and their
              respective documentation, clearly separated and truncated if needed
sourceraw docstring

javasrcclj

(javasrc class-name)
(javasrc class-name method-name)
(javasrc class-name method-name options)

Get the source code for a Java class or method.

When called with just a class name, returns the complete class source. When called with a class name and method name, returns the source for all overloaded versions of that method.

Parameters:

  • class-name: A string containing the fully-qualified class name
  • method-name: (Optional) A string containing the method name to get source for
  • options: (Optional) A map containing configuration options:
    • :max-class-length - Maximum length for class source (default: 2000)
    • :max-method-length - Maximum length for method source (default: 1000)

Returns: For a class: A string containing the complete class source with javadoc comments removed (truncated if too long) For a method: A string with all overloaded method implementations with javadoc comments removed (truncated if too long)

Get the source code for a Java class or method.

When called with just a class name, returns the complete class source.
When called with a class name and method name, returns the source for all
overloaded versions of that method.

Parameters:
- class-name: A string containing the fully-qualified class name
- method-name: (Optional) A string containing the method name to get source for
- options: (Optional) A map containing configuration options:
  - :max-class-length - Maximum length for class source (default: 2000)
  - :max-method-length - Maximum length for method source (default: 1000)

Returns:
For a class: A string containing the complete class source with javadoc comments removed
             (truncated if too long)
For a method: A string with all overloaded method implementations with javadoc comments removed
              (truncated if too long)
sourceraw docstring

methods-ofclj

(methods-of class-name)
(methods-of class-name options)

List all public method signatures available on a Java class.

Parameters:

  • class-name: A string containing the fully-qualified class name
  • options: (Optional) A map containing configuration options:
    • :pattern - A wildcard pattern to filter method names (e.g., "get*", "Name")
    • :max-length - Maximum length for the returned string (default: 3000)

Returns: A string containing the declarations of all public methods in the class, with each method declaration on a separate line. If a pattern is provided in the options map, only methods whose names match the pattern will be included.

Examples:

;; List all methods
(methods "java.util.ArrayList")

;; List only methods matching a pattern
(methods "java.util.ArrayList" {:pattern "add*"})

;; List methods with custom length limit
(methods "java.util.ArrayList" {:max-length 1000})
List all public method signatures available on a Java class.

Parameters:
- class-name: A string containing the fully-qualified class name
- options: (Optional) A map containing configuration options:
  - :pattern - A wildcard pattern to filter method names (e.g., "get*", "*Name*")
  - :max-length - Maximum length for the returned string (default: 3000)

Returns:
A string containing the declarations of all public methods in the class,
with each method declaration on a separate line. If a pattern is provided in
the options map, only methods whose names match the pattern will be included.

Examples:
```clojure
;; List all methods
(methods "java.util.ArrayList")

;; List only methods matching a pattern
(methods "java.util.ArrayList" {:pattern "add*"})

;; List methods with custom length limit
(methods "java.util.ArrayList" {:max-length 1000})
```
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close