Skip to content

KavaRef

A modernizing Java Reflection with Kotlin

KavaRef

Start reflecting anytime, anywhere.

java
public class World {

    private void sayHello(String content) {
        System.out.println("Hello " + content + "!");
    }
}
kotlin
val myWorld = World()

World::class.resolve().firstMethod {
    name = "sayHello"
    parameters(String::class)
}.of(myWorld).invoke("KavaRef")

Released under the Apache-2.0 License