title: Java String validation using enum values and annotation
body: <p>I want to validate a string against a set of values using annotations.</p>
  
  <p>What I want is basically this:</p>
  
  <pre><code>@ValidateString(enumClass=com.co.enum)
  String dataType;
  
  int maxValue;
  int minValue;
  int precision;
  </code></pre>
  
  <p>or</p>
  
  <pre><code>@ValidateString(values={"String","Boolean", "Integer"})
  String dataType;
  
  int maxValue;
  int minValue;
  int precision;
  </code></pre>
  
  <p><br>
  I also want to do some validation on other variables depending upon the value set in <code>dataType</code>:</p>
  
  <pre><code>if (dataType = "String") {
      // maxValue, minValue, precision all should be null or zero
  }
  </code></pre>
  
  <p><br>
  I can't think of a way to achieve this by custom annotations.<br>
  Somebody please help me.</p>