title: what does javax.validation.valid annotation on return type mean?
body: <p>recently I came across a method declaration in the following format:</p>
  
  <pre><code>@GET
  @Path("/foo")
  public @NotNull @Valid String foo()
  {
      ...
  }
  </code></pre>
  
  <p>I have problem understanding what the two annotation <code>@NotNull</code> and <code>@Valid</code> mean. Do they have the same effect if they were declared on top of the method declaration like this?</p>
  
  <pre><code>@GET
  @Path("/foo")
  @NotNull
  @Valid
  public String foo()
  {
      ...
  }
  </code></pre>
  
  <p>And it seems that if I have the <code>@Valid</code> annotation on, accessing other endpoints in the same class as foo will also trigger the execution of <code>foo()</code>.</p>
  
  <p>Could some one share some opinions?</p>
  
  <p>Thanks in advance.</p>