Skip to content

Automatically scan and register classes for reflection using a provider interface

License

Notifications You must be signed in to change notification settings

richarddd/graal-auto-reflection

Repository files navigation

graal-auto-reflection

Automatically scan and register classes for reflection using a provider interface

##Installation

  1. Add Jitpack to repos in gradle.build.kts

    repositories {
       maven {
           url = uri("https://jitpack.io")
       }
    }
  2. Add dependency

    dependencies {
        compile("com.github.richarddd:graal-auto-reflection:-SNAPSHOT")
    }

##Usage

@Suppress("ReplaceJavaStaticMethodWithKotlinAnalog")
class ReflectionData : ReflectionProvider {
    override fun packages(classGraph: ClassGraph) =
        Arrays.asList(
            "com.mongodb.internal.connection",
            "com.mongodb.crypt.capi",
            "org.litote.kmongo.pojo",
            "kotlin.reflect"
        )
    
    override fun classNames(classGraph: ClassGraph) =
            Arrays.asList("com.example.MyClass")

    override fun classes(classGraph: ClassGraph) =
        Arrays.asList(UnixServerAddress::class.java)
}

About

Automatically scan and register classes for reflection using a provider interface

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published