
com.ancientlightstudios.quarkus.kotlin.openapi.models.kotlin.PropertyExpression.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of quarkus-kotlin-openapi-maven-plugin Show documentation
Show all versions of quarkus-kotlin-openapi-maven-plugin Show documentation
A Maven plugin to use the OpenAPI generator.
package com.ancientlightstudios.quarkus.kotlin.openapi.models.kotlin
import com.ancientlightstudios.quarkus.kotlin.openapi.emitter.CodeWriter
class PropertyExpression(private val receiver: KotlinExpression, private val name: KotlinExpression) :
KotlinExpression {
override fun ImportCollector.registerImports() {
registerFrom(receiver)
registerFrom(name)
}
override fun render(writer: CodeWriter) = with(writer) {
receiver.render(this)
write(".")
name.render(this)
}
companion object {
fun KotlinExpression.property(name: VariableName) = PropertyExpression(this, name)
fun KotlinExpression.property(name: ClassName) = PropertyExpression(this, name.companionObject())
fun KotlinExpression.property(name: ConstantName) = PropertyExpression(this, name)
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy