title: Spring validation dependent on other variables
body: <p>I'm trying to write some validation annotations for a Spring project.</p>
  
  <p>I have several fields which are nullable, unless the value of a bool (in the same object) is true.</p>
  
  <p>Is there some easy way to do something like:</p>
  
  <pre><code>@NotNull(if xyz=true)
  </code></pre>
  
  <p>? Thanks</p>