title: Assigning an @Annotation enum a value
body: <p>I created</p>
  
  <pre><code>enum Restrictions{
    none,
    enumeration,
    fractionDigits,
    length,
    maxExclusive,
    maxInclusive,
    maxLength,
    minExclusive,
    minInclusive,
    minLength,
    pattern,
    totalDigits,
    whiteSpace;
  
    public Restrictions setValue(int value){
      this.value = value;
      return this;
    }
    public int value;
  }
  </code></pre>
  
  <p>So that I could happily do something like this, which is perfectly legal syntax.</p>
  
  <pre><code>Restrictions r1 =
    Restrictions.maxLength.setValue(64);
  </code></pre>
  
  <p>The reason being is, I am using enum <strong>to restrict the type of restriction that could be used, and be able to assign a value to that restriction</strong>.</p>
  
  <p>However, my actual motivation is to use that restriction in an @annotation.</p>
  
  <pre><code>@Retention(RetentionPolicy.RUNTIME)
  @Target({ElementType.TYPE, ElementType.FIELD, ElementType.METHOD})
  public @interface Presentable {
    Restrictions[] restrictions() default Restrictions.none;
  }
  </code></pre>
  
  <p>So that, I intended to do this:</p>
  
  <pre><code>@Presentable(restrictions=Restrictions.maxLength.setValue(64))
  public String userName;
  </code></pre>
  
  <p>to which, the compiler croaks</p>
  
  <pre><code>The value for annotation enum attribute must be an enum constant expression.
  </code></pre>
  
  <p>Is there a way to accomplish what I wish to accomplish</p>