public class ProviderHandler extends Object implements Handler
Provider objects. Registers providers and classes and creates
Resolution objects for classes it can handle.| Modifier and Type | Field and Description |
|---|---|
protected Map<Class<?>,ch.jalu.injector.handlers.instantiation.ProviderHandler.ProviderBasedInstantiation<?>> |
providers |
| Constructor and Description |
|---|
ProviderHandler() |
| Modifier and Type | Method and Description |
|---|---|
<T> void |
onProvider(Class<T> clazz,
javax.inject.Provider<? extends T> provider)
Processes the given provider.
|
<T,P extends javax.inject.Provider<? extends T>> |
onProviderClass(Class<T> clazz,
Class<P> providerClass)
Processes the given provider class.
|
Resolution<?> |
resolve(ResolutionContext context)
Resolves the context such that the object identified by the context's object identifier can be
instantiated or retrieved.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitonAnnotation, postProcesspublic <T> void onProvider(Class<T> clazz, javax.inject.Provider<? extends T> provider)
HandleronProvider in interface HandlerT - the class' typeclazz - the class to associate the provider withprovider - the providerpublic <T,P extends javax.inject.Provider<? extends T>> void onProviderClass(Class<T> clazz, Class<P> providerClass)
HandleronProviderClass in interface HandlerT - the class' typeP - the provider class' typeclazz - the class to associate the provider class withproviderClass - the provider classpublic Resolution<?> resolve(ResolutionContext context)
Handler
The returned Resolution must correspond to the type represented by the context's object identifier.
Copyright © 2017. All rights reserved.