title: Check if a field is final in java using reflection
body: <p>I'm writing a class, which at some point has to have all its <code>Field</code>s assigned from another item of this class.</p>
  
  <p>I did it through reflection:</p>
  
  <pre><code>for (Field f:pg.getClass().getDeclaredFields()) {
      f.set(this, f.get(pg));
  }
  </code></pre>
  
  <p>The problem is, that this class contains a <code>Field</code>, which is <code>final</code>. I could skip it by name, but to me that seems not elegant at all.</p>
  
  <p>What's the best way to check if a <code>Field</code> is <code>final</code> in java using reflection?</p>