title: @Value annotation type casting to Integer from String
body: <p>I'm trying to cast the output of a value to an integer:</p>
  
  <pre><code>@Value("${api.orders.pingFrequency}")
  private Integer pingFrequency;
  </code></pre>
  
  <p>The above throws the error </p>
  
  <pre><code>org.springframework.beans.TypeMismatchException: 
      Failed to convert value of type 'java.lang.String' to required type 'java.lang.Integer'; 
  nested exception is java.lang.NumberFormatException: 
      For input string: "(java.lang.Integer)${api.orders.pingFrequency}"
  </code></pre>
  
  <p>I've also tried <code>@Value("(java.lang.Integer)${api.orders.pingFrequency}")</code></p>
  
  <p>Google doesn't appear to say much on the subject.  I'd like to always be dealing with an integer instead of having to parse this value everywhere it's used.</p>
  
  <p><strong>Workaround</strong></p>
  
  <p>I realize a workaround may be to use a setter method to run the conversion for me, but if Spring can do it I'd rather learn something about Spring.</p>