title: How to Load Values for Java Enum Elements from A File
body: <p>I have a Java Enum:</p>
  
  <pre><code>public enum CodeType {
    BRONZE("00001BP", "BAP"),
    SILVER("00002SL", "SAP"),
    GOLD("00003GL", "GAP"),
    MOBILE("00004MB", "TCM"),
    SOCIAL("00005SM", "ASM"),
    WEB_PRESENCE("00006WP", "GLO"),
    EMAIL_MARKETING("00007EM", "PEM"),
    CUSTOM_DIAMOND("00008CD", "PCS"),
    CONSUMER_PORTAL("00009CP", "CPS");
  
    private String code;
    private String key;
  
    CodeType(String code, String key) {
      this.code = code;
      this.key = key;
    }
  
    ...
  }
  </code></pre>
  
  <p>As you see, I have nine elements and each has two values. My question is How can I load values for those elements from a file like properties or xml? I mean:</p>
  
  <pre><code>BRONZE(isLoadedFromFile, isLoadedFromFile),
  ...
  CONSUMER_PORTAL(isLoadedFromFile, isLoadedFromFile);
  </code></pre>
  
  <p>Thanks so much.</p>