clojure.reflect annotations

85 views
Skip to first unread message

Jon Rose

unread,
Jun 1, 2012, 2:38:17 PM6/1/12
to clo...@googlegroups.com
Hello,

I am wondering if anyone knows how to get method annotations from a method using the clojure.reflect library. I going of a Stuart Sierra post on Stack Overflow which game me this

user=> (pprint (reflect "hello"))
{:bases
 
#{java.io.Serializable java.lang.Comparable java.lang.Object
   java
.lang.CharSequence},
 
:flags #{:public :final},
 
:members
 
#{{:name valueOf,
   
:return-type java.lang.String,
   
:declaring-class java.lang.String,
   
:parameter-types [boolean],
   
:exception-types [],
   
:flags #{:static :public}}

which works great but I am also hoping to grab method comments. Is this possible with using interop?

thanks

jon

Jon Rose

unread,
Jun 1, 2012, 2:42:19 PM6/1/12
to clo...@googlegroups.com
sorry, typo. My bluetooth keyboard is geeking out. I meant, is it possible to do this with out using the Jave Reflection classes through interop. 


On Friday, June 1, 2012 11:38:17 AM UTC-7, Jon Rose wrote:
Hello,

I am wondering if anyone knows how to get method annotations from a method using the clojure.reflect library. I am going of a Stuart Sierra post on Stack Overflow which gave me this

user=> (pprint (reflect "hello"))
{:bases
 
#{java.io.Serializable java.lang.Comparable java.lang.Object
   java
.lang.CharSequence},
 
:flags #{:public :final},
 
:members
 
#{{:name valueOf,
   
:return-type java.lang.String,
   
:declaring-class java.lang.String,
   
:parameter-types [boolean],
   
:exception-types [],
   
:flags #{:static :public}}

which works great but I am also hoping to grab method comments. Is this possible with out using interop?

thanks

jon

Armando Blancas

unread,
Jun 1, 2012, 4:39:05 PM6/1/12
to clo...@googlegroups.com
That's the only way I've seen it done.

Cool source box; how did you get it?

Jon Rose

unread,
Jun 1, 2012, 4:42:00 PM6/1/12
to clo...@googlegroups.com
Cool thanks for the info. I just pasted the code snippet in from stack overflow so it must copy the styles too. 
Reply all
Reply to author
Forward
0 new messages