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)
(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))))
Comments top
No comments for wall-hack-method. Log in to add a comment.