Skip to content

Instantly share code, notes, and snippets.

@hoeck
Created September 8, 2010 09:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hoeck/569861 to your computer and use it in GitHub Desktop.
Save hoeck/569861 to your computer and use it in GitHub Desktop.
(defn emit-giws-xml [c]
(let [package (.getPackage c)
methods (map #(hash-map :name (.getName %)
:returnType (str (.getName (.getReturnType %)))
:params (map (fn [p] {:name (.getName %)})
(.getParameterTypes %)))
(.getMethods c))]
methods
))
(clojure.pprint/pprint (emit-giws-xml Object))
({:name "wait", :returnType "void", :params ({:name "wait"})}
{:name "wait",
:returnType "void",
:params ({:name "wait"} {:name "wait"})}
{:name "wait", :returnType "void", :params ()}
{:name "hashCode", :returnType "int", :params ()}
{:name "getClass", :returnType "java.lang.Class", :params ()}
{:name "equals", :returnType "boolean", :params ({:name "equals"})}
{:name "toString", :returnType "java.lang.String", :params ()}
{:name "notify", :returnType "void", :params ()}
{:name "notifyAll", :returnType "void", :params ()})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment