title: How to read arguments value from property file in custom validator in Spring MVC
body: <p>I have created custom validator annotation for firstname as follows:</p>
  
  <pre><code>public class ProfileBean {
  
      @FirstNameValidator(minLength = 2L, maxLength = 10L, pattern = "firstname_pattern}",channelId="abcd")
      private String firstName;
  }
  </code></pre>
  
  <p><code>ProfileBean</code> is my POJO and in custom annotation I want to read <code>minLength</code>, <code>maxLength</code> and pattern value from properties file. How can I do this?</p>
  
  <p>I have one more problem I have to support different channels. For all these channels beans will be different but annotations for given fields are same as follows:
  Channel1:
   public class ProfileBean {</p>
  
  <pre><code>    @FirstNameValidator(minLength = 5L, maxLength = 100L, pattern = "[A-Za-z]{5,100}",channelId="abcd")
      private String firstName;
  }
  </code></pre>
  
  <p>Channel2:
   public class RegisterBean {</p>
  
  <pre><code>    @FirstNameValidator(minLength = 2L, maxLength = 10L, pattern = "[A-Za-z]{2,10}}",channelId="xyz")
      private String foreName;
  }
  </code></pre>
  
  <p>In this case validation implementation is same, but it might be a case that argument value can be different for different channels. In this case in implementation how can we load different properties based on channels. 
  In my case I have defined message bean in xml and and by using instance of that bean I have to read property value.</p>