(defn set-property! [inst prop value]
(let [pd (property-descriptor inst prop)]
(when-not pd
(throw (Exception. (format "No such property %s." prop))))
(let [write-method (.getWriteMethod pd)
dest-class (get-property-class write-method)]
(.invoke write-method inst (into-array [(coerce dest-class value)])))))
Comments top
No comments for set-property!. Log in to add a comment.