   (first (filter #(= class-str (last (str/split (pr-str %) #"\."))) imports)))
 
 (defn init-class [pkg classname import-classes]
+  (debug (str (str/replace pkg #"\." "/") "/" classname))
+
   (let [cw (new org.objectweb.asm.ClassWriter 0)
         clazz (.visit cw Opcodes/V1_8
                       (+ Opcodes/ACC_PUBLIC Opcodes/ACC_SUPER)
-                      (str pkg "/" classname)
+                      (str (str/replace pkg #"\." "/") "/" classname)
                       nil
                       "java/lang/Object"
                       nil)

;;     (makeclass pkg classname (gen-fx-controller fxmlzip fxmlpath cljvec))))

(defn gen-fx-controller-class [fxmlpath clj-fn]
  (let [clj-fn (if (symbol? clj-fn)
                 (str (namespace clj-fn) "/" (name clj-fn))
                 clj-fn)
        fxmlzip (zip-tree-seq (xml/parse (io/input-stream fxmlpath)))
        clazz (get-controller-class fxmlzip)
        [pkg classname] (reverse (map str/reverse (str/split (str/reverse clazz) #"\." 2)))
        cljvec (str/split clj-fn #"/")]
    (gen-fx-controller fxmlzip fxmlpath cljvec [pkg classname])))

;;          (gen-initializer clj-ns clj-fn)
;;          "\n}")))

(defn gen-fx-controller #^Byte [fxmlzip fxmlpath [clj-ns clj-fn] [pkg classname]]
  (let [fxid-elems (get-fxid-elems fxmlzip)
        handler-fns (get-handler-fns fxmlzip)
        import-classes (build-imports fxmlpath)]
    (-> (init-class pkg classname import-classes)
        (gen-props fxid-elems import-classes)
        (gen-handlers handler-fns clj-ns)
        .toByteArray)))

;; ;; Plumber

