Jersey JAX-RS PUT方法。@Consumes注释声明的输入媒体如何注入方法';s参数?

Jersey JAX-RS PUT方法。@Consumes注释声明的输入媒体如何注入方法';s参数?,jersey,jax-rs,Jersey,Jax Rs,我在我的资源类中声明了以下方法 @Path("{id:\\d+}") @PUT @Consumes({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) public Response putPerson(@PathParam("id") long id, Person person) { logger.debug("Going to update the person with

我在我的资源类中声明了以下方法

@Path("{id:\\d+}")
@PUT
@Consumes({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
public Response putPerson(@PathParam("id") long id, Person person) {
    logger.debug("Going to update the person with id: {} to name {} age {} and salary {}", id, person.getName(), person.getAge(), person.getSalary());
    db.put(id, person);
    return Response.noContent().build();
}
在这里,我理解由于@PathParam注释,我的{id}路径值确实被注入到id参数中。但是我很好奇,如何将@Consumes注释声明的输入媒体注入person参数?我很好奇,因为没有声明要将任何值注入person参数的注释

我知道介质会被注入,因为我的logger语句会打印正确的值


这个注入过程是否记录在Jersey用户手册或任何JavaDocs中?

我在年发布的Jersey 2.31版用户指南中找到了答案。内容如下

与与提取相关联的方法参数不同 请求参数,与 正在使用的表示不需要注释。换句话说 表示(实体)参数不需要 特定的“实体”注释。不带注释的方法参数 是一个实体最多可使用一个此类未注方法参数 存在,因为最多只能有一个这样的表示 已发送请求