Hi, On Tue, Jul 1, 2014 at 9:07 AM, Felix Meschberger <[email protected]> wrote: > ..there are options available...
Just a wild idea, how about this: Foo f = someObject.adaptTo(RequireAdapter.for(Foo.class)); which could be handled by the AdapterManagerImpl, by wrapping whatever adapter it finds so that a null result throws a CannotAdaptException? Needs some magic so that RequireAdapter.for manufactures a class that triggers the AdapterManagerImpl wrapping, but that should be doable with proxies or bytecode manipulation, and that magic is just between RequireAdapter and AdapterManagerImpl, so doesn't leak everywhere. -Bertrand
