ClojureDocs

Nav

Namespaces

get-proxy-class

clojure.core

Available since 1.0 (source)
  • (get-proxy-class & bases)
Takes an optional single class followed by zero or more
interfaces. If not supplied class defaults to Object.  Creates an
returns an instance of a proxy class derived from the supplied
classes. The resulting value is cached and used for any subsequent
requests for the same class set. Returns a Class object.
1 Example
;; generates a new Java class extending/implementing the given classes/interfaces:
;; See "construct-proxy" on how to get an instance.

(import '[clojure.lang IDeref IObj])
(def DocumentException (get-proxy-class Exception IDeref))

(type DocumentException)
;; java.lang.Class

(ancestors DocumentException)
;; #{java.io.Serializable 
;;   clojure.lang.IProxy 
;;   java.lang.Exception 
;;   clojure.lang.IDeref 
;;   java.lang.Object 
;;   java.lang.Throwable}
See Also

Takes a proxy class and any arguments for its superclass ctor and creates and returns an instance ...

Added by reborg
0 Notes
No notes for get-proxy-class