Replies: 1 comment
-
FTR. I also tried using SimpleResourceInfo.getParameters. The problem is however, that getParameters return Class, and not type. I have in this way also no way to retrieve the actual type of T. (GreetingListSortAttribute) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I have following resource:
I now want to provide a custom paramconverter. SortAttributes are always parsed in the same way.
However, I have no way to get the specific type of the parameter; The rawType is always SortAttribute instead of GreetingListSortAttribute.
A
fromString
method on the GreetingListSortAttribute is correctly called. I do not want to add these methods everywhere, since SortAttributes are quite commonplace in my application. I would prefer to write a generic paramconverter once.My question is therefore, how to retrieve the specific type used on the resource (GreetingListSortAttribute)?
One idea, to use
@Context ResourceInfo
, and check the invoked resourceMethod using reflection.Any other ideas?
Beta Was this translation helpful? Give feedback.
All reactions