title: Dynamically Generate enum values
body: <p>I have been looking around for a good example on how I might go about dynamically generating enum values.  I found a couple good articles, however I am looking for a compile time solution and what I've found is only at run time.</p>
  
  <p>Does anyone know if this is even possible?  I have yet to find anything that hints it might be.</p>
  
  <p>Thanks!</p>
  
  <p><strong>EDIT:
  For clarification: I would like to be able to read values out of a database and populate an enum with those values.</strong></p>
  
  <p>In a perfect world, I would like my enum class to look like the following:</p>
  
  <pre><code>public static enum STATE {
  
      /* populated from DB if possible */
      MA("high taxes", 6),
      NH("low taxes", 3),
      ...
      ...
  
      private String desc;
      private in rating;
  
      public STATE (String description, int rating) {
  
          this.desc = description;
          this.rating = rating;
      }
  }
  </code></pre>