title: How do I pull `static final` constants from a Java class into a Clojure namespace?
body: <p>I am trying to wrap a Java library with a Clojure binding.  One particular class in the Java library defines a bunch of static final constants, for example:</p>
  
  <pre><code>class Foo {
      public static final int BAR = 0;
      public static final int SOME_CONSTANT = 1;
      ...
  }
  </code></pre>
  
  <p>I had a thought that I might be able to inspect the class and pull these constants into my Clojure namespace without explicitly <code>def</code>-ing each one.  </p>
  
  <p>For example, instead of explicitly wiring it up like this:</p>
  
  <pre><code>(def foo-bar Foo/BAR)
  (def foo-some-constant Foo/SOME_CONSTANT)
  </code></pre>
  
  <p>I'd be able to inspect the <code>Foo</code> class and dynamically wire up <code>foo-bar</code> and <code>foo-some-constant</code> in my Clojure namespace when the module is loaded.</p>
  
  <p>I see two reasons for doing this:</p>
  
  <p>A) Automatically pull in new constants as they are added to the <code>Foo</code> class.  In other words, I wouldn't have to modify my Clojure wrapper in the case that the Java interface added a new constant.</p>
  
  <p>B) I can guarantee the constants follow a more Clojure-esque naming convention</p>
  
  <p>I'm not really sold on doing this, but it seems like a good question to ask to expand my knowledge of Clojure/Java interop.  </p>
  
  <p>Thanks</p>