``` override fun toJSON(json: JsonBuilder) { ...
# tornadofx
r
Copy code
override fun toJSON(json: JsonBuilder) {
        with(json){
            add("name", name)
            add("dropAllowed", dropAllowed)
            add("children", children.toJSON())
        }
    }

    override fun updateModel(json: JsonObject) {
        with(json){
            name = json.getString("name")
            dropAllowed = json.getBoolean("dropAllowed")
            children.setAll(json.getJsonArray("children").toModel())
        }
    }