jvm.reflect
.%
macro
added in 3.0
(.% obj)Lists class information (.% String) => (contains {:modifiers #{:instance :public :final :class}, :name “java.lang.String”})
.%>
macro
added in 3.0
(.%> obj)Lists the class and interface hierarchy for the class
(.%> String) => [java.lang.String java.lang.Object #{java.lang.constant.ConstantDesc java.io.Serializable java.lang.Comparable java.lang.constant.Constable java.lang.CharSequence}]
.&
macro
added in 3.0
(.& obj)pretty prints the data representation of a value
(.& {:a 1 :b 2 :c 3})
.*
macro
added in 3.0
(.* obj & selectors)lists what methods could be applied to a particular instance
(.* “abc” #“^to”)
(.* String :name #“^to”) => (contains “toString”)
.*>
macro
added in 3.0
(.*> obj & selectors)lists what methods could be applied to a particular instance
(.*> “abc” #“^to”)
(.*> String :name #“^to”) => (contains “toString”)
.>
macro
added in 3.0
(.> obj)(.> obj method)(.> obj method & more)Threads the first input into the rest of the functions. Same as -> but allows access to private fields using both :keyword and .symbol lookup:
(.> “abcd” :value String.) => “abcd”
(.> “abcd” .value String.) => “abcd”
(comment “BROKEN” (def -b- (byte-array (.getBytes “world”))) (let a “hello” _ (.> “hello” (.value -b-)) a) => “world”)
.?
macro
added in 3.0
(.? obj & selectors)queries the java view of the class declaration
(.? String #“^c” :name) => (contains “charAt”) ;;[“charAt” “chars” “checkBoundsBeginEnd” ;; “checkBoundsOffCount” “checkIndex” “checkOffset” ;; “codePointAt” “codePointBefore” “codePointCount” “codePoints” ;; “coder” “compareTo” “compareToIgnoreCase” “concat” “contains” ;; “contentEquals” “copyValueOf”]
.?*
macro
added in 3.0
(.?* obj & selectors)queries the the class hierarchy
(.?* String #“^to”)
.?>
macro
added in 3.0
(.?> obj & selectors)queries the the class hierarchy
(.?> String #“^to”)
query-printed
added in 3.0
(query-printed type query-fn obj selectors)prints the output on the result to display
(query-printed “CLASS” query/query-class String #“^c” :name)
(query-printed “CLASS” query/query-class String #“^c”)