Stephane Bailliez
2011-12-30 04:15:47 UTC
I'm trying to figure out if it is possible to implement a
StringReaderProvider that delegates extraction of the generic type to other
providers.
In some way the logic would be similar to the
MultivaluedParameterExtractorFactory but I cannot find any way to actually
get ahold of the list of providers (StringReaderWorkers) in such a provider.
I see that everything is initialized 'manually' in WebApplicationImpl and
the StringReaderFactory is created, configured and injected manually but I
don't seem to find any extension point to be able to get it via normal
injection.
Any pointers ?
If you wonder what this is for, this is to support Google Guava Optional<T>
for @QueryParam. I have something that works right now, but that required
me to define manually the list of the StringReaderProvider, as well as
reimplemented an entire queryparam injectable provider so that is not
really optimal while it seems everything could be done within one single
StringReaderProvider since this is basically just a wrapper around a type.
Cheers,
-- stephane
StringReaderProvider that delegates extraction of the generic type to other
providers.
In some way the logic would be similar to the
MultivaluedParameterExtractorFactory but I cannot find any way to actually
get ahold of the list of providers (StringReaderWorkers) in such a provider.
I see that everything is initialized 'manually' in WebApplicationImpl and
the StringReaderFactory is created, configured and injected manually but I
don't seem to find any extension point to be able to get it via normal
injection.
Any pointers ?
If you wonder what this is for, this is to support Google Guava Optional<T>
for @QueryParam. I have something that works right now, but that required
me to define manually the list of the StringReaderProvider, as well as
reimplemented an entire queryparam injectable provider so that is not
really optimal while it seems everything could be done within one single
StringReaderProvider since this is basically just a wrapper around a type.
Cheers,
-- stephane