title: How to suppress missing javadoc checkstyle warning on enum constants/values?
body: <p>Checkstyle is complaining about enum values not having an attached javadoc comment.  But at least in many of my enums, since the values themselves are often self-explanatory, adding javadoc simply seems to reduce readability with unneeded clutter.  Consider the following examples:</p>
  
  
  
  <pre><code>/**
   * Example enum to illustrate the problem.  Each value of this
   * enum represents a day of the week.
   */
  public enum DaysOfWeekClean {
  
      SUNDAY,
      MONDAY,
      TUESDAY,
      WEDNESDAY,
      THURSDAY,
      FRIDAY,
      SATURDAY;
  
  }
  </code></pre>
  
  
  
  <pre><code>/**
   * Example enum to illustrate the problem.  Each value of this
   * enum represents a day of the week, with comments added to each
   * distinct value to make the point.
   */
  public enum DaysOfWeekCluttered {
  
      /**
       * The day of the week named "Sunday".
       */
      SUNDAY,
  
      /**
       * The day of the week named "Monday".
       */
      MONDAY,
  
      /**
       * The day of the week named "Tuesday".
       */
      TUESDAY,
  
      /**
       * The day of the week named "Wednesday".
       */
      WEDNESDAY,
  
      /**
       * The day of the week named "Thursday".
       */
      THURSDAY,
  
      /**
       * The day of the week named "Friday".
       */
      FRIDAY,
  
      /**
       * The day of the week named "Saturday".
       */
      SATURDAY;
  
  }
  </code></pre>
  
  <p>If the <code>JavadocVariable</code> module is added to my checks, the first example (<code>DaysOfWeekClean</code>) will be flagged, while the second example (<code>DaysOfWeekDirty</code>) will pass.</p>
  
  <p>And that leaves me in a bit of a dilemma.  I want checkstyle to flag normal class members/variables which are not commented, but to leave my enum constants alone.  After quite a bit of searching through the Checkstyle documentation (and the Checkstyle source code itself) and several StackOverflow questions, I can't seem to figure out how to set this up.</p>
  
  <p>I can warn when javadoc is missing from <strong>both</strong> enum constants and class members/variables or I can ignore both, but I can't seem to check one and not the other.</p>
  
  <hr>
  
  <p>For reference, here are some checkstyle configurations which I have tried, and their results:</p>
  
  <ol>
  <li><p>Simple declaration which warns when both a class member or enum constant has no javadoc:</p>
  
  <pre><code>&lt;module name="JavadocVariable" /&gt;
  </code></pre></li>
  <li><p>Declaration which warns when either a class member or enum constant has no javadoc:</p>
  
  <pre><code>&lt;module name="JavadocVariable"&gt;
      &lt;property name="tokens" value="VARIABLE_DEF" /&gt;
  &lt;/module&gt;
  </code></pre></li>
  <li><p>Declaration which FAILS to warn when either a class member or enum constant has no javadoc:</p>
  
  <pre><code>&lt;module name="JavadocVariable"&gt;
      &lt;property name="tokens" value="ENUM_CONSTANT_DEF" /&gt;
  &lt;/module&gt;
  </code></pre></li>
  </ol>