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

php - How can I edit my code to echo the data of child's element where my search term was found in, in XMLReader? -

javascript - Iterate over array and calculate average values of array-parts -

iphone - Using nested NSDictionary with Picker -