我是 kotlinpoet 的新手,我一直在阅读文档,它似乎是一个很棒的库,但我找不到解决我的问题的示例。
我有一个依赖项lib-domain-0.1.jar,其中有业务对象,例如:
package pe.com.business.domain
data class Person(val id: Int? = null, val name: String? = null)
...
..
package pe.com.business.domain
data class Departament(val id: Int? = null, val direction: String? = null)
...
..
.
Run Code Online (Sandbox Code Playgroud)
我想构建一个新的依赖项,lib-domain-fx-0-1.jar它具有相同的域,但具有 JavaFx 属性(使用 Tornadofx),例如:
package pe.com.business.domainfx
import tornadofx.*
class Person {
val idProperty = SimpleIntegerProperty()
var id by idProperty
val nameProperty = SimpleStringProperty()
var name by nameProperty
}
...
..
package pe.com.business.domainfx
import tornadofx.*
class Departament {
val idProperty …Run Code Online (Sandbox Code Playgroud)