code: public void annotateFieldJSR303(JMethod getter, boolean addValidAnnotation) {
  		if (isRequired()) {
  			getter.annotate(NotNull.class);
  		}
  		if (StringUtils.hasText(getPattern())) {
  			JAnnotationUse annotation = getter.annotate(Pattern.class);
  			annotation.param("regexp", getPattern());
  		}
  		if (getMinLength() != null || getMaxLength() != null) {
  			JAnnotationUse annotation = getter.annotate(Size.class);
  
  			if (getMinLength() != null) {
  				annotation.param("min", getMinLength());
  			}
  
  			if (getMaxLength() != null) {
  				annotation.param("max", getMaxLength());
  			}
  		}
  		if (addValidAnnotation) {
  			getter.annotate(Valid.class);
  		}
  
  		if (minimum != null) {
  			JAnnotationUse annotation = getter.annotate(DecimalMin.class);
  			annotation.param("value", String.valueOf(minimum));
  		}
  
  		if (maximum != null) {
  			JAnnotationUse annotation = getter.annotate(DecimalMax.class);
  			annotation.param("value", String.valueOf(maximum));
  		}
  	}
docs: Adds validation annotations to the supplied method
  
  @param getter
  getter method to add validation annotation to
  @param addValidAnnotation
  if {@code @Valid} annotation dhould be added