Is there a way to use the (JAX-RS) Jersey reflection api to access methods given as an argument?

Jersey must handle internal resource mappings so that, given the URL (/ root / my / resource), it will call the appropriate annotated class / method to handle the request. I searched the api looking for a way to get the class instance (and the correct method) pointed to by a given path. Is it possible?

For example:

Class<?> clazz = SomeJerseyMethodToGetClass('/root/my/resource'); 


I found something similar in this post: Find a list of all Jersey resource methods in my application? but in this case I will need to know the processing class in advance. Any thoughts?

Thanks in advance.


source to share

All Articles