title: How @Digits constraint (Bean Validation-JSR 303) supports String type?
body: <p>While studying BeanValidation from documented <a href="http://beanvalidation.org/1.0/spec/#d0e5601" rel="nofollow">here</a>, I came to know that <code>@Digits</code> supports <code>String</code> datatype. here the snap-shot from documentation. </p>
  
  <pre><code>package javax.validation.constraints;
  
  /**
   * The annotated element must be a number within accepted range
   * Supported types are:
   * &lt;ul&gt;
   * &lt;li&gt;&lt;code&gt;BigDecimal&lt;/code&gt;&lt;/li&gt;
   * &lt;li&gt;&lt;code&gt;BigInteger&lt;/code&gt;&lt;/li&gt;
   * &lt;li&gt;&lt;code&gt;String&lt;/code&gt;&lt;/li&gt;
   * &lt;li&gt;&lt;code&gt;byte&lt;/code&gt;, &lt;code&gt;short&lt;/code&gt;, &lt;code&gt;int&lt;/code&gt;, &lt;code&gt;long&lt;/code&gt;,
   * and their respective wrapper types&lt;/li&gt;
   * &lt;/ul&gt;
   * &lt;p/&gt;
   * &lt;code&gt;null&lt;/code&gt; elements are considered valid
   *
   * @author Emmanuel Bernard
   */
  </code></pre>
  
  <p>How can Digits behave for String type? On what base <code>@Digit</code> will validate to <code>String</code> type? Will it behave like digit regex validation (@Pattern)?</p>