public class GuiceComponentProvider extends Object implements ComponentProvider
Constructor and Description |
---|
GuiceComponentProvider(Map<Class<?>,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.
|
com.google.inject.Injector |
getInjector() |
GuiceComponentProvider |
getParent() |
<T> javax.inject.Provider<T> |
getProvider(Class<T> type) |
<T> T |
getSingleton(Class<T> type)
Deprecated.
|
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) |
public GuiceComponentProvider(Map<Class<?>,Class<?>> typeMappings, GuiceComponentProvider parentComponentProvider)
public <T> Class<? extends T> getImplementation(Class<T> type)
ComponentProvider
getImplementation
in interface ComponentProvider
@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 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–2016 Magnolia International Ltd.. All rights reserved.