Back

javadoc (clj)

(source)

function

(javadoc class-or-object)
Opens a browser window displaying the javadoc for the argument. Tries *local-javadocs* first, then *remote-javadocs*.

Examples

clojure/core.typed

(deftest javadoc-test
  (is-tc-e #(javadoc 1) [-> Any]
           :requires [[clojure.java.javadoc :refer [javadoc]]]))

(deftest add-local-javadoc-test
  (is-tc-e #(add-local-javadoc 1) [-> (List Any)]
           :requires [[clojure.java.javadoc :refer [add-local-javadoc]]])
  (is-tc-err #(add-local-javadoc 1) [-> String]
             :requires [[clojure.java.javadoc :refer [add-local-javadoc]]]))

(deftest add-remote-javadoc-test
  (is-tc-e #(add-remote-javadoc 
              "org.apache.commons.csv." 
              "http://commons.apache.org/proper/commons-csv/apidocs/index.html") 
           [-> (Map Any Any)]
           :requires [[clojure.java.javadoc :refer [add-remote-javadoc]]])
  (is-tc-err #(add-remote-javadoc 
                "org.apache.commons.csv."
                "http://commons.apache.org/proper/commons-csv/apidocs/index.html")
             [-> String]
             :requires [[clojure.java.javadoc :refer [add-remote-javadoc]]])
  (is-tc-err #(add-remote-javadoc 
                1 
                "http://commons.apache.org/proper/commons-csv/apidocs/index.html") 
             [-> (Map Any Any)]
             :requires [[clojure.java.javadoc :refer [add-remote-javadoc]]]))
PrecursorApp/precursor
(ns pc.repl
  "Utility functions to make repl access more convenient.
   Also serves as a guide for how nses should be aliased"
  (:require [cemerick.url :as url]
            [cheshire.core :as json]
            [clj-http.client :as http]
            [clj-time.core :as time]
            [clojure.core.async :as async]
            [clojure.java.javadoc :refer (javadoc)]
            [clojure.repl :refer :all]
            [datomic.api :as d]
            [pc.billing :as billing]
            [pc.datomic :as pcd]
            [pc.datomic.web-peer :as web-peer]
            [pc.email :as email]
            [pc.http.plan :as plan-http]
            [pc.http.sente :as sente]
            [pc.models.chat :as chat-model]
            [pc.models.cust :as cust-model]
            [pc.models.doc :as doc-model]
            [pc.models.flag :as flag-model]
            [pc.models.issue :as issue-model]
            [pc.models.layer :as layer-model]
            [pc.models.permission :as permission-model]
            [pc.models.plan :as plan-model]
            [pc.models.team :as team-model]
            [pc.stripe :as stripe]
            [slingshot.slingshot :refer (try+ throw+)]))

(defmacro java-doc [x]
  `(do
     (require 'clojure.java.javadoc)
     (clojure.java.javadoc/javadoc ~x)))
typedclojure/typedclojure
(deftest javadoc-test
  (is-tc-e #(javadoc 1) [-> t/Any]
           :requires [[clojure.java.javadoc :refer [javadoc]]]))

(deftest add-local-javadoc-test
  (is-tc-e #(add-local-javadoc 1) [-> (t/List t/Any)]
           :requires [[clojure.java.javadoc :refer [add-local-javadoc]]])
  (is-tc-err #(add-local-javadoc 1) [-> String]
             :requires [[clojure.java.javadoc :refer [add-local-javadoc]]]))

(deftest add-remote-javadoc-test
  (is-tc-e #(add-remote-javadoc 
              "org.apache.commons.csv." 
              "http://commons.apache.org/proper/commons-csv/apidocs/index.html") 
           [-> (t/Map t/Any t/Any)]
           :requires [[clojure.java.javadoc :refer [add-remote-javadoc]]])
  (is-tc-err #(add-remote-javadoc 
                "org.apache.commons.csv."
                "http://commons.apache.org/proper/commons-csv/apidocs/index.html")
             [-> String]
             :requires [[clojure.java.javadoc :refer [add-remote-javadoc]]])
  (is-tc-err #(add-remote-javadoc 
                1 
                "http://commons.apache.org/proper/commons-csv/apidocs/index.html") 
             [-> (t/Map t/Any t/Any)]
             :requires [[clojure.java.javadoc :refer [add-remote-javadoc]]]))
reborg/clojure-essential-reference
(require '[clojure.java.javadoc :as jdoc])

(jdoc/javadoc []) ; <1>

(binding [jdoc/*feeling-lucky* false] ; <2>
  (jdoc/javadoc []))
;; Could not find Javadoc for clojure.lang.PersistentVector
reborg/clojure-essential-reference
(require '[clojure.java.javadoc :as browse]) ; <1>

(browse/javadoc "this is a string object") ; <2>
;; true

(browse/javadoc #("this fn class is not documented")) ; <3>