Liking cljdoc? Tell your friends :D

hara.io.classpath


all-jarsclj

(all-jars & [x :as coords])

gets all jars, either on the classloader or coordinate

(-> (all-jars) count) => 150

(-> (all-jars '[org.eclipse.aether/aether-api "1.1.0"]) count) => 1

gets all jars, either on the classloader or coordinate

(-> (all-jars)
    count)
=> 150

(-> (all-jars '[org.eclipse.aether/aether-api "1.1.0"])
    count)
=> 1
raw docstring

artifactclj

(artifact)
(artifact x)
(artifact type x)

converts to various artifact formats

(artifact) => #{:path :coord :default :string}

(artifact '[hello "2.5"]) => (contains {:group "hello", :artifact "hello", :extension "jar", :classifier nil, :version "2.5"})

(artifact :string '[hello "2.5"]) => "hello:hello:jar:2.5"

converts to various artifact formats

(artifact)
=> #{:path :coord :default :string}

(artifact '[hello "2.5"])
=> (contains {:group "hello",
              :artifact "hello",
              :extension "jar",
              :classifier nil,
              :version "2.5"})

(artifact :string '[hello "2.5"])
=> "hello:hello:jar:2.5"
raw docstring

class-seqclj

(class-seq)
(class-seq coords)

creates a sequence of class names

(-> (all-jars '[org.eclipse.aether/aether-api "1.1.0"]) (class-seq) (count)) => 128

creates a sequence of class names

(-> (all-jars '[org.eclipse.aether/aether-api "1.1.0"])
    (class-seq)
    (count))
=> 128
raw docstring

match-jarsclj

(match-jars names)
(match-jars names coords)

matches jars from any representation

(match-jars '[org.eclipse.aether/aether-api "1.1.0"]) => ("<.m2>/org/eclipse/aether/aether-api/1.1.0/aether-api-1.1.0.jar")

matches jars from any representation

(match-jars '[org.eclipse.aether/aether-api "1.1.0"])
=> ("<.m2>/org/eclipse/aether/aether-api/1.1.0/aether-api-1.1.0.jar")
raw docstring

resolve-classloaderclj

(resolve-classloader x)
(resolve-classloader x loader)

resolves a class or namespace to a physical location

(resolve-classloader String) => ["<java>/jre/lib/rt.jar" "java/lang/String.class"]

(resolve-classloader 'hara.test) => [nil "<dev>/hara/src/hara/test.clj"]

resolves a class or namespace to a physical location

(resolve-classloader String)
=> ["<java>/jre/lib/rt.jar" "java/lang/String.class"]

(resolve-classloader 'hara.test)
=> [nil "<dev>/hara/src/hara/test.clj"]
raw docstring

resolve-entryclj

(resolve-entry x)
(resolve-entry x context)
(resolve-entry x context {:keys [tag] :or {tag :path} :as opts})

resolves a class or namespace within a context

(resolve-entry 'hara.test "zcaudate:hara.test:2.4.8") => ["<.m2>/im/chit/hara.test/2.4.8/hara.test-2.4.8.jar" "hara/test.clj"]

(resolve-entry 'hara.test ["zcaudate:hara.test:2.4.8" "zcaudate:hara.string:2.4.8"] {:tag :coord}) => '[[zcaudate/hara.test "2.4.8"] "hara/test.clj"]

(resolve-entry 'hara.test '[[zcaudate/hara.test "2.4.8"] [zcaudate/hara.string "2.4.8"]]) => ["<.m2>/im/chit/hara.test/2.4.8/hara.test-2.4.8.jar" "hara/test.clj"]

(resolve-entry 'hara.test '[zcaudate/hara.test "2.4.8"]) => ["<.m2>/im/chit/hara.test/2.4.8/hara.test-2.4.8.jar" "hara/test.clj"]

(resolve-entry 'hara.test '[zcaudate/hara.string "2.4.8"]) => nil

resolves a class or namespace within a context

(resolve-entry 'hara.test
               "zcaudate:hara.test:2.4.8")
=> ["<.m2>/im/chit/hara.test/2.4.8/hara.test-2.4.8.jar"
    "hara/test.clj"]

(resolve-entry 'hara.test
               ["zcaudate:hara.test:2.4.8"
                "zcaudate:hara.string:2.4.8"]
               {:tag :coord})
=> '[[zcaudate/hara.test "2.4.8"] "hara/test.clj"]


(resolve-entry 'hara.test
               '[[zcaudate/hara.test "2.4.8"]
                 [zcaudate/hara.string "2.4.8"]])
=> ["<.m2>/im/chit/hara.test/2.4.8/hara.test-2.4.8.jar"
    "hara/test.clj"]

(resolve-entry 'hara.test
               '[zcaudate/hara.test "2.4.8"])
=> ["<.m2>/im/chit/hara.test/2.4.8/hara.test-2.4.8.jar"
    "hara/test.clj"]

(resolve-entry 'hara.test
               '[zcaudate/hara.string "2.4.8"])
=> nil
raw docstring

resolve-jar-entryclj

(resolve-jar-entry x artifact)
(resolve-jar-entry x artifact {:keys [tag] :or {tag :path}})

resolves a class or namespace within a jar

(resolve-jar-entry 'hara.test '[zcaudate/hara.test "2.4.8"]) => ["<.m2>/im/chit/hara.test/2.4.8/hara.test-2.4.8.jar" "hara/test.clj"]

(resolve-jar-entry 'hara.test "zcaudate:hara.test:2.4.8" {:tag :coord}) => '[[zcaudate/hara.test "2.4.8"] "hara/test.clj"]

resolves a class or namespace within a jar

(resolve-jar-entry 'hara.test
                   '[zcaudate/hara.test "2.4.8"])
=> ["<.m2>/im/chit/hara.test/2.4.8/hara.test-2.4.8.jar"
    "hara/test.clj"]

(resolve-jar-entry 'hara.test
                   "zcaudate:hara.test:2.4.8"
                   {:tag :coord})
=> '[[zcaudate/hara.test "2.4.8"]
     "hara/test.clj"]
raw docstring

resource-entryclj

(resource-entry x)

creates a entry-path based on input

(resource-entry "hello/world.txt") => "hello/world.txt"

(resource-entry 'version-clj.core) => "version_clj/core.clj"

(resource-entry java.io.File) => "java/io/File.class"

creates a entry-path based on input

(resource-entry "hello/world.txt")
=> "hello/world.txt"

(resource-entry 'version-clj.core)
=> "version_clj/core.clj"

(resource-entry java.io.File)
=> "java/io/File.class"
raw docstring

(search matches classes)

searches a pattern for class names

(->> (.getURLs cls/+base+) (map #(-> % str (subs (count "file:")))) (filter #(.endsWith % "jfxrt.jar")) (class-seq) (search [#"^javafx.*[A-Za-z0-9]Builder$"]) (take 5)) => (javafx.animation.AnimationBuilder javafx.animation.FadeTransitionBuilder javafx.animation.FillTransitionBuilder javafx.animation.ParallelTransitionBuilder javafx.animation.PathTransitionBuilder)

searches a pattern for class names

 (->> (.getURLs cls/+base+)
      (map #(-> % str (subs (count "file:"))))
      (filter #(.endsWith % "jfxrt.jar"))
      (class-seq)
      (search [#"^javafx.*[A-Za-z0-9]Builder$"])
      (take 5))
=> (javafx.animation.AnimationBuilder
     javafx.animation.FadeTransitionBuilder
     javafx.animation.FillTransitionBuilder
     javafx.animation.ParallelTransitionBuilder
     javafx.animation.PathTransitionBuilder)
raw docstring

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

× close