title: How to retrieve attribute from ControllerAdvice selector in ControllerAdvice class
body: <p>I can define a Spring ControllerAdvice that is selectively used by a subset of controllers using a custom annotation:</p>
  
  <pre><code>@RestController
  @UseAdviceA
  @RequestMapping("/myapi")
  class ApiController {
   ...
  }
  
  @ControllerAdvice(annotations = UseAdviceA.class)
  class AdviceA {
  
   ...
  }
  </code></pre>
  
  <p>But is it possible to pass in an attribute via the custom annotation where the advice class can pick up from the annotation? For e.g.:</p>
  
  <pre><code>@RestController
  @UseAdviceA("my.value")
  @RequestMapping("/myapi")
  class ApiController {
   ...
  }
  
  @ControllerAdvice(annotations = UseAdviceA.class)
  class AdviceA {
   // Some way to get the string "myvalue" from the instance of UseAdviceA
   ...
  }
  </code></pre>
  
  <p>Any other way to achieve the same outcome, which is to be able to define a custom configuration at the Controller method which can be passed to the ControllerAdvice would be much appreciated too.</p>