mirror of
https://github.com/spring-projects/spring-framework
synced 2026-06-08 17:33:33 +00:00
d84c4a39e2
Closes gh-36310
19 lines
868 B
Plaintext
19 lines
868 B
Plaintext
[[kotlin-classes-interfaces]]
|
|
= Classes and Interfaces
|
|
:page-section-summary-toc: 1
|
|
|
|
The Spring Framework supports various Kotlin constructs, such as instantiating Kotlin classes
|
|
through primary constructors, data binding for immutable classes, and optional parameters
|
|
with default values for functions.
|
|
|
|
Kotlin parameter names are recognized through a dedicated `KotlinReflectionParameterNameDiscoverer`,
|
|
which allows finding interface method parameter names without requiring the Java `-parameters`
|
|
compiler flag to be enabled during compilation.
|
|
|
|
TIP: For completeness, we nevertheless recommend running the Kotlin compiler with its
|
|
`-java-parameters` flag for standard Java parameter exposure.
|
|
|
|
You can declare configuration classes as
|
|
{kotlin-docs}/nested-classes.html[top level or nested but not inner],
|
|
since the latter requires a reference to the outer class.
|