public class GuiceComponentProvider extends Object implements ComponentProvider
ComponentProvider
,
GuiceComponentProviderBuilder
Constructor and Description |
---|
GuiceComponentProvider(Map<com.google.inject.Key,Class> typeMappings,
GuiceComponentProvider parentComponentProvider) |
Modifier and Type | Method and Description |
---|---|
void |
destroy() |
<T> T |
getComponent(Class<T> type)
Returns the component mapped for a given type.
|
<T> Class<? extends T> |
getImplementation(Class<T> type)
Returns the implementation type mapped for a given type.
|
<T> Class<? extends T> |
getImplementation(com.google.inject.Key<T> type) |
com.google.inject.Injector |
getInjector() |
GuiceComponentProvider |
getParent() |
<T> javax.inject.Provider<T> |
getProvider(Class<T> type) |
<T> T |
getSingleton(Class<T> type)
Deprecated.
|
Map<com.google.inject.Key,Class> |
getTypeMappings() |
void |
injectMembers(Object instance) |
<T> T |
newInstance(Class<T> type,
Object... parameters)
Creates a new instance of the passed interface / class by using the registered implementation.
|
<T> T |
newInstanceWithParameterResolvers(Class<T> type,
ParameterResolver... parameterResolvers) |
<T> T |
newInstanceWithParameterResolvers(com.google.inject.Key<T> type,
ParameterResolver... parameterResolvers) |
public GuiceComponentProvider(Map<com.google.inject.Key,Class> typeMappings, GuiceComponentProvider parentComponentProvider)
public <T> Class<? extends T> getImplementation(Class<T> type)
ComponentProvider
getImplementation
in interface ComponentProvider
public <T> Class<? extends T> getImplementation(com.google.inject.Key<T> type)
@Deprecated public <T> T getSingleton(Class<T> type)
ComponentProvider
getSingleton
in interface ComponentProvider
ComponentProvider.getComponent(Class)
public <T> T getComponent(Class<T> type) throws NoSuchComponentException
ComponentProvider
getComponent
in interface ComponentProvider
NoSuchComponentException
- in case the component wasn't foundpublic <T> T newInstance(Class<T> type, Object... parameters)
ComponentProvider
MgnlInstantiationException
is thrown.newInstance
in interface ComponentProvider
public <T> T newInstanceWithParameterResolvers(Class<T> type, ParameterResolver... parameterResolvers)
newInstanceWithParameterResolvers
in interface ComponentProvider
public <T> T newInstanceWithParameterResolvers(com.google.inject.Key<T> type, ParameterResolver... parameterResolvers)
public com.google.inject.Injector getInjector()
public <T> javax.inject.Provider<T> getProvider(Class<T> type)
public void injectMembers(Object instance)
public void destroy()
public GuiceComponentProvider getParent()
getParent
in interface ComponentProvider
Copyright © 2003–2018 Magnolia International Ltd.. All rights reserved.