wall-hack-method

clojure.contrib.java-utils

  • (wall-hack-method class-name method-name params obj & args)
Calls a private or protected method.
params is a vector of class which correspond to the arguments to the method
obj is nil for static methods, the instance object otherwise
the method name is given as a symbol or a keyword (something Named)

0 Examples top

Log in to add / edit an example.

See Also top

Log in to add a see also.

Plus_12x12 Minus_12x12 Source clojure/contrib/java_utils.clj:202 top

(defn wall-hack-method
  "Calls a private or protected method.
   params is a vector of class which correspond to the arguments to the method
   obj is nil for static methods, the instance object otherwise
   the method name is given as a symbol or a keyword (something Named)"
  {:deprecated "1.2"}
  [class-name method-name params obj & args]
  (-> class-name (.getDeclaredMethod (name method-name) (into-array Class params))
    (doto (.setAccessible true))
    (.invoke obj (into-array Object args))))
Vars in clojure.contrib.java-utils/wall-hack-method: -> defn doto into-array name
Used in 0 other vars

Comments top

No comments for wall-hack-method. Log in to add a comment.