title: Advanced use of the Jersey resource model: variable annotation for entity
body: <p>I need to use the programmatic API to build a Jersey resource method and define its handling method/class/inflector. At the end, the resource should look like something like this:</p>
  
  <pre><code>@Path("helloworld")
  public class HelloWorldResource {
  
    @POST
    @Consumes("text/plain")
    public String getHello(
      @CustomEntityAnnotation("World") CustomEntityClass name) {
        return "Hello " + name.toString() +  "!";
    }
  }
  </code></pre>
  
  <p>But I need to build many such resources with different values for paths and more importantly: different values for the <code>@CustomEntityAnnotation</code> annotation.</p>
  
  <p>Let me add that this annotation must later be accessed by a <code>ContainerResponseFilter</code>, and by a <code>MessageBodyWriter&lt;CustomEntityClass&gt;</code>.</p>
  
  <p>Unfortunately, I can't find in the docs where I shall add this annotation to the resource Method model builder, and what should be the signature of the method handler.</p>
  
  <p>Any help would be very much appreciated.</p>
  
  <p>Kind regards,
  Maxime</p>