clojure - Generating Java Classes -


i understand 1 can use gen-class generate java class, however, i'm confused how can generate java class with constructors. possible generate java class constructor, not extend or implement class?

i generated following class constructor:

(ns test.t1   (:import (java.util hashmap))   (:gen-class    :main false    :state state    :init init    :constructors {[java.util.hashmap] []})) (defn -init [^hashmap tmapref]   [[] tmapref]) 

and able create instance of it:

user> (test.t1. (java.util.hashmap.)) #<t1 test.t1@7d6ac92e> 

Comments

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -