javalin-xt is a very lightweight set of extension features dedicated to Javalin.
Key concepts of javalin-xt include:
Designed to be as lightweight as possible. It does not introduce any additional dependencies to your project. Just the most basic and useful features that can enhance working with Javalin.
No use of reflection in its features. Everything is done at compile time.
No heavy use of proxies, annotations, or other complex mechanisms under the hood. Everything is kept simple in order to make any potential debugging or troubleshooting easier.
Can be considered as an extension to Javalin. Using it, you can still use Javalin as you would normally do, but with the
added benefit of javalin-xt features accessible via Javalin app
.
Specifically designed to work with Javalin which allows for a more streamlined and efficient integration.
Feature | Description |
---|---|
Dependency injection | Simple and lightweight dependency injection (DI) framework that uses no reflection. |
Application properties | Simple engine to read and access application properties in a Spring Boot-like way via application.yml stored in your resources. |
Declarative routing | Simple way to define routes in a declarative way using minimized set of annotations and no reflection |
Currently, javalin-xt is still in development 🚧. Therefore:
- Kotlin support only (support for Java is planned in the future)
- Some features may have limited functionality
- Gradle support only
plugins {
id("io.mzlnk:javalin-xt") version "1.0.0"
}
To be announced soon.
To enable javalin-xt, you just need to invoke dedicated method on JavalinConfig
instance during Javalin creation. For
example:
fun main(args: Array<String>) {
val app = Javalin.create { config ->
// enables IoC container and dependency injection
config.enableIoC()
// enables application properties engine
config.enableApplicationProperties { propertiesConfig ->
propertiesConfig.profile = "dev"
}
}
// registers declaratively defined endpoint
app.registerEndpoint(SampleEndpoint())
app.start(8080)
}
Now you can start exploring javalin-xt features. All the features are described in details in the Wiki section:
There are example project using different build tools available in the examples
directory.
javalin-xt is licensed under the Apache License, Version 2.0. See LICENSE for more information.
Contributions are welcome! Please see CONTRIBUTING for more information.
javalin-xt is developed by: