 (defn typeQname [t]
   (classQname t))
 
-(defn getModifiers [el]
-  (if (map? el)
-    (getModifiers (:field el))
-    (.getModifiers el)))
-
-(defn isPrivate? [cl]
-  (let [ms (getModifiers cl)]
-    (ModifierSet/isPrivate ms)))
-
-(defn isPublic? [cl]
-  (let [ms (getModifiers cl)]
-    (ModifierSet/isPublic ms)))
-
-(defn isProtected? [cl]
-  (let [ms (getModifiers cl)]
-    (ModifierSet/isProtected ms)))
-
-(defn isStatic? [cl]
-  (let [ms (getModifiers cl)]
-    (ModifierSet/isStatic ms)))
-
-(defn isFinal? [cl]
-  (let [ms (getModifiers cl)]
-    (ModifierSet/isFinal ms)))
-
-(defn hasPackageLevelAccess? [cl]
-  (not
-    (or
-      (isPublic? cl)
-      (isPrivate? cl)
-      (isProtected? cl))))
-
-(defn isPublicOrHasPackageLevelAccess? [el]
-  (or
-    (isPublic? el)
-    (hasPackageLevelAccess? el)))
-
-(defn isNotPrivate? [cl]
-  (complement isPrivate?))
-
 ; TODO Consider internal classes
 (defn getClasses [cu]
   (filter isClass? (.getTypes cu)))

  (parseFiles (java-files dirname)))

; ============================================
; Model
; ============================================

(defn isClass? [n]

    (instance? ClassOrInterfaceDeclaration n)
    (not (.isInterface n))))

(defn isInterface? [n]
  (and
    (instance? ClassOrInterfaceDeclaration n)
    (.isInterface n)))

(defn isEnum? [n]
  (instance? EnumDeclaration n))

; ============================================
; Modifiers
; ============================================

(defprotocol modifiersProtocol
  (getModifiers [this]))

(extend-protocol modifiersProtocol
  TypeDeclaration
  (getModifiers [this] (.getModifiers this)))

(extend-protocol modifiersProtocol
  MethodDeclaration
  (getModifiers [this] (.getModifiers this)))

(extend-protocol modifiersProtocol
  FieldDeclaration
  (getModifiers [this] (.getModifiers this)))

(defn isPrivate? [cl]
  (let [ms (getModifiers cl)]
    (ModifierSet/isPrivate ms)))

(defn isPublic? [cl]
  (let [ms (getModifiers cl)]
    (ModifierSet/isPublic ms)))

(defn isProtected? [cl]
  (let [ms (getModifiers cl)]
    (ModifierSet/isProtected ms)))

(defn isStatic? [cl]
  (let [ms (getModifiers cl)]
    (ModifierSet/isStatic ms)))

(defn isFinal? [cl]
  (let [ms (getModifiers cl)]
    (ModifierSet/isFinal ms)))

(defn hasPackageLevelAccess? [cl]
  (not
    (or
      (isPublic? cl)
      (isPrivate? cl)
      (isProtected? cl))))

(defn isPublicOrHasPackageLevelAccess? [el]
  (or
    (isPublic? el)
    (hasPackageLevelAccess? el)))

(defn isNotPrivate? [cl]
  (complement isPrivate?))

; ============================================
; Abstractions
; ============================================

(defrecord SingleFieldDeclaration [field variable]
  modifiersProtocol
    (getModifiers [this] (getModifiers field)))

; ============================================
; Model
; ============================================

(defn packageName [n]
  (if (instance? CompilationUnit n)
