Accessing protected methods is a pain. You could do it with reflection, as 
Bill said.

In gen-class, you need to add the `:exposes-methods` option to gen-class. 
This will make the protected method available as a public method, under an 
alternate name.

For example, if you're extending Java class A which has 
protectedMethod(parameter), you would have something like:

    (ns com.example.subclass-of-A
      (:gen-class :extends com.example.A
         :exposes-methods {protectedMethod exposedSuperMethod}))
    
    (defn -protectedMethod [this parameter]
      (.exposedSuperMethod this parameter))

-Stuart Sierra
clojure.com

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to