Say I have a java library with the following pseudo code :
abstract class B {
public void method2(String param2) {...}
}
class A extends B {
public void method1(String param1) {...}
}
I want to use this from Clojure.
I have an instance of A, and I want to invoke method2 without going through Reflection methods.
What's the quickest way ?
asked Jul 3, 2014 at 6:10
Nicolas Modrzyk
14.2k2 gold badges39 silver badges40 bronze badges
1 Answer 1
If you have an instance of A you can just call method2 using normal interop:
(.method2 (A.) "param")
answered Jul 3, 2014 at 9:52
sw1nn
7,3381 gold badge28 silver badges37 bronze badges
Sign up to request clarification or add additional context in comments.
1 Comment
Nicolas Modrzyk
I am going to mark your answer correct regarding my own question; my real problem was that the method was actually protected not public, so I had to go through reflection.
lang-clj