Support for recursively converting Java beans to Clojure and vice versa.
Support for recursively converting Java beans to Clojure and vice versa.
Specify the behavior of missing setters in to-java in the default object case, using one of :ignore, :log, :error
Specify the behavior of missing setters in to-java in the default object case, using one of :ignore, :log, :error
Convert a Java object to a Clojure map.
Convert a Java object to a Clojure map.
Convert a Java object to a Clojure map (but do not convert deeply).
The second argument is a hash map that offers some control over the conversion:
Convert a Java object to a Clojure map (but do not convert deeply). The second argument is a hash map that offers some control over the conversion: * :add-class -- if true, add :class with the actual class of the object being converted -- this mimics clojure.core/bean. * :omit -- a set of properties (keywords) to omit from the conversion so that unsafe methods are not called.
(set-properties instance props)
Given an existing Java object and a Clojure map, use reflection to set the properties.
Given an existing Java object and a Clojure map, use reflection to set the properties.
Convert Clojure data to an instance of the specified Java class. Several basic types have obvious conversions, but for a hash map reflection is used to set the properties. If the class is an interface, we can't create an instance of it, unless the Clojure map already implements it.
When java.time.Instant is available (Java 8+), we can convert a hash map containing :nano and :epochSecond to Instant, as this is the reverse of Instant->map.
A XMLGregorianCalendar object can be constructed from the following keys :year, :month, :day, :hour, :minute, :second, and :timezone.
Convert Clojure data to an instance of the specified Java class. Several basic types have obvious conversions, but for a hash map reflection is used to set the properties. If the class is an interface, we can't create an instance of it, unless the Clojure map already implements it. When java.time.Instant is available (Java 8+), we can convert a hash map containing :nano and :epochSecond to Instant, as this is the reverse of Instant->map. A XMLGregorianCalendar object can be constructed from the following keys :year, :month, :day, :hour, :minute, :second, and :timezone.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close