(describe-class class-name)
(describe-class class-name methodName)
(describe-class class-name methodName paramName)
Gets comprehensive information about a Java class, method, or parameter.
This function has three arities:
Arity 1: (describe-class class-name) Parameters:
Returns: A map containing detailed information about the class, including its docstring and documentation for all public methods, enriched with documentation from parent classes where available.
Arity 2: (describe-class class-name method-name) Parameters:
Returns: A string containing the source code of all methods with the given name in the class, including all overloaded versions, separated by newlines.
Arity 3: (describe-class class-name method-name param-name) Parameters:
Returns: A string containing the Javadoc description of the specified parameter, or nil if the parameter or its documentation doesn't exist.
Note: Use find-classes-by-simple-name to find fully-qualified class names when you only know the simple name of a class.
Gets comprehensive information about a Java class, method, or parameter. This function has three arities: Arity 1: (describe-class class-name) Parameters: - class-name: A string containing the fully-qualified name of the class Returns: A map containing detailed information about the class, including its docstring and documentation for all public methods, enriched with documentation from parent classes where available. Arity 2: (describe-class class-name method-name) Parameters: - class-name: A string containing the fully-qualified name of the class - method-name: A string containing the name of a method to find Returns: A string containing the source code of all methods with the given name in the class, including all overloaded versions, separated by newlines. Arity 3: (describe-class class-name method-name param-name) Parameters: - class-name: A string containing the fully-qualified name of the class - method-name: A string containing the name of a method - param-name: A string containing the name of a parameter in the method Returns: A string containing the Javadoc description of the specified parameter, or nil if the parameter or its documentation doesn't exist. Note: Use find-classes-by-simple-name to find fully-qualified class names when you only know the simple name of a class.
(enrich-method-docs-from-parents class-name methods-docs)
Enriches method documentation by looking for missing information in parent classes and interfaces.
Parameters:
Returns: A vector of method documentation maps with missing documentation fields filled in from parent classes and interfaces when available.
This function looks at each method in the provided methods-docs and checks if it has complete documentation (description, parameters, and return value). If any information is missing, it searches parent classes for the same method to find and incorporate the missing documentation.
The function automatically downloads source JARs for parent classes when needed.
Enriches method documentation by looking for missing information in parent classes and interfaces. Parameters: - class-name: A string containing the fully-qualified class name - methods-docs: A vector of maps containing method documentation Returns: A vector of method documentation maps with missing documentation fields filled in from parent classes and interfaces when available. This function looks at each method in the provided methods-docs and checks if it has complete documentation (description, parameters, and return value). If any information is missing, it searches parent classes for the same method to find and incorporate the missing documentation. The function automatically downloads source JARs for parent classes when needed.
(extract-class-info class-name)
Extracts basic information about a Java class from its source code.
Parameters:
Returns: A map containing the following keys:
Returns nil if the class declaration cannot be found or parsed.
This function extracts only the information available directly in the class's source code, without enriching method documentation from parent classes.
Extracts basic information about a Java class from its source code. Parameters: - class-name: A string containing the fully-qualified class name Returns: A map containing the following keys: - :class-name - The fully-qualified class name - :docstring - The class-level Javadoc description, or nil if none exists - :methods - A vector of maps containing documentation for each public method Returns nil if the class declaration cannot be found or parsed. This function extracts only the information available directly in the class's source code, without enriching method documentation from parent classes.
(extract-class-info-with-parents class-name)
Extracts comprehensive information about a Java class, including documentation from parent classes.
Parameters:
Returns: A map containing the following keys:
Returns nil if the class declaration cannot be found or parsed.
This function first extracts the basic class information and then enriches any methods with incomplete documentation by searching for that documentation in parent classes and interfaces. This provides more complete documentation even when a class doesn't fully document inherited methods.
Extracts comprehensive information about a Java class, including documentation from parent classes. Parameters: - class-name: A string containing the fully-qualified class name Returns: A map containing the following keys: - :class-name - The fully-qualified class name - :docstring - The class-level Javadoc description, or nil if none exists - :methods - A vector of maps containing enriched documentation for each public method Returns nil if the class declaration cannot be found or parsed. This function first extracts the basic class information and then enriches any methods with incomplete documentation by searching for that documentation in parent classes and interfaces. This provides more complete documentation even when a class doesn't fully document inherited methods.
(extract-method-docs method)
Extracts documentation for a Java method from its Javadoc comments.
Parameters:
Returns: A map containing the following keys:
If the method has no Javadoc, default empty values are provided for the documentation fields.
Extracts documentation for a Java method from its Javadoc comments. Parameters: - method: A MethodDeclaration object from the JavaParser library Returns: A map containing the following keys: - :name - The name of the method - :declaration - The full method declaration as a string - :description - The main description from the Javadoc, or empty string if none - :params - A map from parameter names to their descriptions, or empty map if none - :return - The return value description, or nil if none If the method has no Javadoc, default empty values are provided for the documentation fields.
(filter-methods methods pattern)
Filters method information based on a pattern.
Parameters:
Returns: A filtered sequence of method info maps whose names match the pattern.
Filters method information based on a pattern. Parameters: - methods: A sequence of method info maps - pattern: A wildcard pattern to match method names (can contain * and ?) Returns: A filtered sequence of method info maps whose names match the pattern.
(find-classes-by-simple-name simple-name)
Finds all fully-qualified class names on the classpath matching a simple class name.
Parameters:
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.
The function caches results for better performance in subsequent calls. Inner classes are skipped and not included in the results.
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').
Finds 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. The function caches results for better performance in subsequent calls. Inner classes are skipped and not included in the results. 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').
(find-method-docs-in-parent parent-class method-name)
Finds documentation for a specific method in a parent class.
Parameters:
Returns: A map containing the documentation for the method if found, with keys:
Returns nil if the parent class cannot be found, if it doesn't contain the method, or if the method doesn't have any documentation.
Finds documentation for a specific method in a parent class. Parameters: - parent-class: A string containing the fully-qualified name of a parent class/interface - method-name: A string containing the name of the method to find documentation for Returns: A map containing the documentation for the method if found, with keys: - :description - The main description from the Javadoc - :params - A map from parameter names to their descriptions - :return - The return value description Returns nil if the parent class cannot be found, if it doesn't contain the method, or if the method doesn't have any documentation.
(methods-of class-name)
(methods-of class-name pattern)
Gets a formatted string listing public method declarations for a class.
Parameters:
Returns: A string containing the declarations of matching public methods in the class, with each method declaration on a separate line. Returns an empty string if the class cannot be found or has no matching methods.
This function provides a convenient way to see available methods on a class at once, which is useful for API exploration and discovery.
Gets a formatted string listing public method declarations for a class. Parameters: - class-name: A string containing the fully-qualified class name - pattern: (Optional) A wildcard pattern to filter method names (e.g., 'get*', '*Name*') Returns: A string containing the declarations of matching public methods in the class, with each method declaration on a separate line. Returns an empty string if the class cannot be found or has no matching methods. This function provides a convenient way to see available methods on a class at once, which is useful for API exploration and discovery.
(wildcard-to-regex pattern)
Converts a wildcard pattern (e.g., 'get*', 'Name') to a regex pattern.
Converts a wildcard pattern (e.g., 'get*', '*Name*') to a regex pattern.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close