I write a class extends ContainerRequestFilter for permission check. How can I get the matched methods' annotation for permission check.
@javax.ws.rs.ext.Provider
public class AuthorizationRequestFilter implements ContainerRequestFilter {
public void filter(ContainerRequestContext requestContext) throws IOException {
// how can I get resources' methods' annotation here?
// from the resource below , I want to checkout whether the target matched method contains the @ReadPermission annotation
}
}
@Path("/region")
public class Region {
@POST
@Path("/{region_id}")
@Produces({MediaType.APPLICATION_JSON , MediaType.APPLICATION_XML})
@ReadPermission
public String getRegion() {
return null;
}
}