Package org.xwiki.component.embed
Class GenericProvider<T>
- java.lang.Object
-
- org.xwiki.component.embed.GenericProvider<T>
-
- Type Parameters:
T
- the role type
- All Implemented Interfaces:
javax.inject.Provider<T>
public class GenericProvider<T> extends Object implements javax.inject.Provider<T>
Default provider used when the Component Manager needs to inject aProvider
field but no custom Provider has been registered. The default behavior is simply to look up the Component role class whenProvider.get()
is called. This is useful for example when you wish to do "lazy injection".- Since:
- 3.3M2
- Version:
- $Id: 26dea6cd43aefa7e4b053a91855a1da9a11c584c $
-
-
Field Summary
Fields Modifier and Type Field Description protected ComponentManager
componentManager
-
Constructor Summary
Constructors Constructor Description GenericProvider(ComponentManager componentManager, org.xwiki.component.internal.RoleHint<T> roleHint)
-
-
-
Field Detail
-
componentManager
protected ComponentManager componentManager
-
-
Constructor Detail
-
GenericProvider
public GenericProvider(ComponentManager componentManager, org.xwiki.component.internal.RoleHint<T> roleHint)
- Parameters:
componentManager
- the Component Manager instance that we'll use to look up the Component Role duringProvider.get()
roleHint
- the Component Role and Hint that uniquely identify the Component we wish to provide for
-
-
Method Detail
-
getInstance
protected T getInstance(Type type, String hint) throws ComponentLookupException
- Throws:
ComponentLookupException
-
-