fs [skip ci]
This commit is contained in:
parent
8326825494
commit
4daef2fbcc
2 changed files with 35 additions and 19 deletions
2
fs
2
fs
|
|
@ -1 +1 @@
|
|||
Subproject commit f4e36fe231fc7041c3d2dc65df5d3608f1648a24
|
||||
Subproject commit 6c150a1b48cac48151f13223b1cf5f889e8e9ef9
|
||||
|
|
@ -319,9 +319,7 @@
|
|||
|
||||
(def class-map (gen-class-map))
|
||||
|
||||
(defn generate-reflection-file
|
||||
"Generate reflection.json file"
|
||||
[& args]
|
||||
(defn reflection-file-entries []
|
||||
(let [entries (vec (for [c (sort (:all classes))
|
||||
:let [class-name (str c)]]
|
||||
{:name class-name
|
||||
|
|
@ -344,24 +342,42 @@
|
|||
:let [class-name (str c)]]
|
||||
(assoc v :name class-name))
|
||||
all-entries (concat entries constructors methods fields custom-entries)]
|
||||
all-entries))
|
||||
|
||||
(defn generate-reflection-file
|
||||
"Generate reflection.json file"
|
||||
[& args]
|
||||
(let [all-entries (reflection-file-entries)]
|
||||
(spit (or
|
||||
(first args)
|
||||
"reflection.json") (json/generate-string all-entries {:pretty true}))))
|
||||
|
||||
(defn public-declared-method? [c m]
|
||||
(and (= c (.getDeclaringClass m))
|
||||
(not (.getAnnotation m Deprecated))))
|
||||
|
||||
(defn public-declared-method-names [c]
|
||||
(->> (.getMethods c)
|
||||
(keep (fn [m]
|
||||
(when (public-declared-method? c m)
|
||||
{:class c
|
||||
:name (.getName m)})))
|
||||
(distinct)
|
||||
(sort-by :name)
|
||||
(vec)))
|
||||
|
||||
(defn all-methods []
|
||||
(->> (reflection-file-entries)
|
||||
(map :name)
|
||||
(map #(Class/forName %))
|
||||
(mapcat public-declared-method-names)))
|
||||
|
||||
(comment
|
||||
|
||||
(defn public-declared-method? [c m]
|
||||
(and (= c (.getDeclaringClass m))
|
||||
(not (.getAnnotation m Deprecated))))
|
||||
|
||||
(defn public-declared-method-names [c]
|
||||
(->> (.getMethods c)
|
||||
(keep (fn [m]
|
||||
(when (public-declared-method? c m)
|
||||
{:name (.getName m)})))
|
||||
(distinct)
|
||||
(sort-by :name)
|
||||
(vec)))
|
||||
|
||||
(public-declared-method-names java.net.URL)
|
||||
(public-declared-method-names java.util.Properties))
|
||||
(public-declared-method-names java.util.Properties)
|
||||
|
||||
(->> (reflection-file-entries)
|
||||
(map :name)
|
||||
(map #(Class/forName %)))
|
||||
|
||||
)
|
||||
|
|
|
|||
Loading…
Reference in a new issue