In Scala/Java, how to inspect where a method is defined? -


for example, saw scala expression this:

objx.methody 

there seems no way see methody came from, may came from:

(1) class of objx, let's call classx

(2) super class of objx (classx), let's call superclassx

(3) class called classz, classz irrelevant objx, there implicit conversion classx classz.

so there may 3 possibilities source of methody, have ideas how find out methody defined?

in other words, in scala, how inspect information of method (especially method came implicit conversion) @ runtime?

there possibility class has method declared reflection. namings:

objx.getclass().getmethod("methody").getdeclaringclass(); 

Comments

Popular posts from this blog

android - MPAndroidChart - How to add Annotations or images to the chart -

javascript - Add class to another page attribute using URL id - Jquery -

firefox - Where is 'webgl.osmesalib' parameter? -